phpunit:如何在不运行测试的情况下获取测试目录中的测试计数

I would like to statically get a count of number of tests in a directory. Is there something available that I can use? Phpunit seems to have a count before test runs say 0/100 and increments it as the test completes. I would like to fetch that number before hand and exit the run possibly.

The --count-tests option of phploc can give you, just like the grep / wc -l line shown above, an estimate of the number of tests. Due to data providers, for instance, there cannot be an exact number without actually executing the tests.