Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy PHPUnit executes code when generating coverage report?
    primarykey
    data
    text
    <p>Dear stackoverflowers, We are developing a web application based on cakephp. CakePHP turns out to be a bit hard to use in a TDD manner and therefore we have are trying to develop the least amount of code possible on the framework it self by extracting all business logic out to classes that do not depend on cakephp. As such, we are able to test our libraries using phpunit with minimal problems. However, we do want to included the untested code in our coverage report more than anything to keep an eye on the amount of glue code between cake and our libraries that we can not test. The problem is then that when telling phpunit to account for these code it goes crazy parsing and executing cakephp's code and it breaks miserably. My question is: Why is phpunit executing this code at all? Is there something we are not understanding or doing wrong here? Here is the phpunit.xml file we are using:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;phpunit backupGlobals="true" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" syntaxCheck="false" testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"&gt; &lt;filter&gt; &lt;whitelist addUncoveredFilesFromWhitelist="true"&gt; &lt;directory suffix=".php"&gt;app&lt;/directory&gt; &lt;exclude&gt; &lt;directory suffix=".php"&gt;tests&lt;/directory&gt; &lt;directory suffix=".php"&gt;app/webroot&lt;/directory&gt; &lt;directory suffix=".php"&gt;app/plugins&lt;/directory&gt; &lt;directory suffix=".php"&gt;app/vendors&lt;/directory&gt; &lt;directory suffix=".php"&gt;app/config&lt;/directory&gt; &lt;directory suffix=".php"&gt;app/tmp&lt;/directory&gt; &lt;directory suffix=".php"&gt;cake&lt;/directory&gt; &lt;directory suffix=".php"&gt;vendors&lt;/directory&gt; &lt;/exclude&gt; &lt;/whitelist&gt; &lt;/filter&gt; &lt;/phpunit&gt; </code></pre> <p>Thanks for any help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload