2

我试过这个 phpunit --debug --filter /^complete/ feed.php;

出于某种原因,它说 0 个测试。

如果我这样做phpunit --debug --filter /complete/ feed.php;,它会使用“完成”这个词来命中任何功能

4

1 回答 1

7

那是因为$name测试的完全合格表示为Classname::testname

所以你需要使用::而不是^

像:

$ phpunit --filter /::testIs/
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /var/www/.../phpunit.xml

..

Time: 1 second, Memory: 10.75Mb

OK (2 tests, 4 assertions)
于 2012-05-09T20:49:46.570 回答