我有一个有趣的(但最终无害的)问题:PHPUnit将报告没有执行任何测试,然后继续读取配置文件并运行测试,给出如下输出。
似乎PHPUnit正在退出,然后由于某种原因恢复。我查看了我的引导过程和日志文件,我看不到任何会导致PHPUnit退出的事件(异常或退出语句等)。
使用PHPUnit phar从test目录运行测试:php ../phpunit.phar -c phpunit.xml
以前有人见过这种行为吗?问题是什么?最终,这根本不会伤害任何事情,我只是好奇发生了什么。
PHPUnit 3.7.34 by Sebastian Bergmann.
Time: 2.18 seconds, Memory: 23.50Mb
No tests executed!
PHPUnit 3.7.34 by Sebastian Bergmann.
Configuration read from /path/to/phpunit.xml
............................................................. 61 / 2630 ( 2%)
............................................................. 122 / 2630 ( 4%)
.. and so on ..
配置文件似乎也没问题,因为测试确实在运行。
<phpunit
colors="true"
bootstrap="/path/to/application/bootstrap.php"
backupGlobals="false"
>
<testsuites>
<testsuite name="Unit Tests">
<directory>./</directory>
</testsuite>
</testsuites>
</phpunit>
答案 0 :(得分:1)
尝试使用--debug
运行PHPUnit以查看最新情况。