0
votes

I have a big phpunit test suite (in fact it's four testsuites for this particular project) and when executing, phpunit shows that there are 903 tests:

...............................................................  63 / 903 (  6%)

When it's done, it shows the result:

OK (901 tests, 1872 assertions)

As you can see, I'm missing two tests. This can be because they have a incorrect group (my phpunit.xml filters groups) or maybe there is something wrong. As there are so many tests, I have no clue how to find the tests which don't get executed. Is there any way to get the names of this tests?

1
Did you try running phpunit with --verbose or --debug ?Jakub Zalas
Did you try it with the --verbose argument?dan-lee
while --debug shows me every test which gets executed, --verbose does not show any information at all. I tried --list-groups which shows me my three groups and one __nogroup__. Using this group with --group __nogroup__ showed me one test where two private methods are named with prefix "test", resulting in phpunit thinking these are real tests while they are not.Sgoettschkes

1 Answers

2
votes

The reason for this behaviour where two private methods which where prefixed with the word "test". It seems that for the total count of tests, phpunit takes into account all methods prefixed with "test", no matter if they can be executed or not.

I found out about it using the --list-groups options on phpunit, which gave me a a group named __nogroup__. Executing only this tests using --group __nogroup__ gave me the class in which the two private methods where located.