Created
November 19, 2013 22:45
-
-
Save EvanK/7553935 to your computer and use it in GitHub Desktop.
Pro tip: PHPUnit's test suite "exclude" nodes don't do wildcard expansion. Took me longer than I'd like to admit figuring this out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<phpunit> | |
<testsuites> | |
<testsuite name="Unit"> | |
<directory>../src/*/Bundle/*Bundle/Tests</directory> | |
<exclude>src/*/Bundle/*Bundle/Tests/Functional</exclude> | |
</testsuite> | |
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<phpunit> | |
<testsuites> | |
<testsuite name="Unit Tests"> | |
<directory>../src/*/Bundle/*Bundle/Tests</directory> | |
<exclude>src/MyProject/Bundle/MyFirstBundle/Tests/Functional</exclude> | |
<exclude>src/MyProject/Bundle/MySecondBundle/Tests/Functional</exclude> | |
<exclude>src/MyProject/Bundle/MyThirdBundle/Tests/Functional</exclude> | |
<exclude>src/MyProject/Bundle/MyNthBundle/Tests/Functional</exclude> | |
</testsuite> | |
</testsuites> | |
</phpunit> |
Thx for sharing.
Also I'd like to add that exclude are ignored if a path is added within the command line.
Someone should probably do something about this lol
So.. maybe someone changed it as this is what my phpunit file looks like, and it works as intended:
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./HCI</directory>
<exclude>
<directory suffix=".php">./HCI/*/Routes</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./report" charset="UTF-8"
yui="true" highlight="true"
lowUpperBound="50" highLowerBound="80" />
</logging
ok, thanks... lol
took me a few hours to figure it out
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍