Skip to content

Instantly share code, notes, and snippets.

@samsonasik
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samsonasik/299defe1e70c39e300f3 to your computer and use it in GitHub Desktop.
Save samsonasik/299defe1e70c39e300f3 to your computer and use it in GitHub Desktop.
phpunit issue
<phpunit bootstrap="Bootstrap.php" colors="true">
<testsuite name="MyTest" >
<directory>./MyModuleTest</directory>
</testsuite>
<filter>
<whitelist>
<directory>./../../../../module/MyModule/src</directory>
<file>./../../../../module/MyModule/Module.php</file>
</whitelist>
<blacklist>
<directory>./../../../../vendor</directory>
<directory>./../../../../module/OtherModuleDependency</directory>
<directory>./../../../../module/OtherModuleDependency1</directory>
<directory>./../../../../module/OtherModuleDependency2</directory>
</blacklist>
</filter>
<logging>
<log type="coverage-html" target="./../../../../data/test-html-report/mymodule/" charset="UTF-8" yui="true" />
</logging>
</phpunit>
@samsonasik
Copy link
Author

the vendor and other module still shown in coverage even i blacklisted them. if i only use blacklist, it works but it only show tested file, untested files didn't shown in the coverage. I tried to use :

<directory>./../../src</directory>
<exclude>
    <directory>./../../test</directory>
</exclude>

in whitelist too but not works.

@Xerkus
Copy link

Xerkus commented May 24, 2015

I use only whitelist and never had coverage issue... It shows files in that directory only

<filter>
    <whitelist addUncoveredFilesFromWhitelist="true">
        <directory suffix=".php">./src</directory>
    </whitelist>
</filter> 

@samsonasik
Copy link
Author

@Xerkus I did it, but still same, I've fixed it by use only blacklist, but add "test" folder and files to blacklist too.
btw, thank you ;)

@samsonasik
Copy link
Author

hm.., just realized, it actually not fix at all, "some" untested files still not shown in coverage...

@samsonasik
Copy link
Author

it fixed in phpunit 4.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment