I tested it on my Symfony demo project (the Bundles
suggests that this is what you are using) and I have the same issue. It seems to be a combination of two problems. First, there is a known bug with running PHPUnit (PHPUnit 3.7.19) with the -c
or --config
option:
https://github.com/sebastianbergmann/phpunit/issues/928
When running it elsewhere and specifying the config file using --config, the exclude would however stop working.
Second, the exclude
directive seems to ignore / fail when there is any globbing (*
) in the path, so by removing the globbing, it worked for me:
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
<directory>../src/*/Bundle/*Bundle/Tests</directory>
<exclude>../src/Blah/MyBundle/Tests/Controller/</exclude>
</testsuite>
</testsuites>
It's the only way I found to exclude the Tests in MyBundle
as required. The globbing did not work for the exclude
. But then, it means you have to add as many exclude
directives as there are folders you want to ignore.
Probable related gihub issue: https://github.com/sebastianbergmann/phpunit/pull/573
[...] this fix lands in the 4.0 release as it breaks backwards compatibility.
- Solution #1: remove any globbing in your paths
- Solution #2: Upgrade to PHPUnit v4.* (not tested by myself, see comments, doesn't solve the problem of
exclude
paths with globbing)