在phpunit.xml中忽略/取消忽略测试

时间:2016-09-21 12:05:06

标签: php phpunit

我正在使用Laravel,我想只运行一个测试文件,并且不想重命名或编辑所有测试代码,指定要忽略的内容以及为我运行的内容最方便的地方是{ {1}}所以我这样做了:

phpunit.xml

如你所见,我评论了 <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" syntaxCheck="false"> <testsuites> <testsuite name="Application Test Suite"> <!--<directory>./tests/</directory>--> <file>./tests/RunJustThisTest.php</file> </testsuite> </testsuites> <php> <env name="APP_ENV" value="testing"/> <env name="CACHE_DRIVER" value="array"/> <env name="SESSION_DRIVER" value="array"/> </php> </phpunit> 文件夹,但其中的所有文件仍在运行,这是荒谬的,我甚至都不知道phpunit在哪里获取该文件夹的路径???我想只运行./tests/文件。我想在/tests/RunJustThisTest.php文件中指定它,而不是在控制台或代码中弄乱。

我在Netbeans中加载phpunit.xml文件。

phpunit.xml

enter image description here

1 个答案:

答案 0 :(得分:1)

这是2011年的Netbeans错误。他们说&#34;对于大多数用户来说,这是预期的行为。&#34;。

这是参数--run=C:\xampp\htdocs\yyy\tests

如果有人解决了这个问题请分享。

Why Netbean ignore PHPUnit testsuite from the XML config?

https://netbeans.org/bugzilla/show_bug.cgi?id=199072

相关问题