繁体   English   中英

无法在PHPStorm中运行PHPUnit测试

[英]Unable to run PHPUnit test in PHPStorm

我有一个使用PHPStorm IDE在PHPUnit上运行的测试套件。 但是,由于以下问题,其中一项测试曾经失败了,
PHP Warning: Cannot modify header information - headers already sent by ...

我通过添加@runInSeparateProcess批注来解决此问题。

我能够在终端中成功运行所有测试。 但是,当我尝试使用PHPStorm IDE运行测试时,最终得到以下错误消息-

PHPUnit_Framework_Exception : PHPUnit 4.2.5 by Sebastian Bergmann.

Usage: phpunit [options] UnitTest [UnitTest.php]
       phpunit [options] <directory>
Code Coverage Options:

--coverage-clover <file>  Generate code coverage report in Clover XML format.

...(basically prints out the output of phpunit --help)

仅在运行先前因标题错误消息而失败的相同测试时,才能看到此结果。

请协助我解决此问题。 任何帮助将不胜感激。

谢谢!

终于设法解决了! 我删除了@runInSeparateProcess的测试的@runInSeparateProcess批注以及运行配置中的--stderr选项。 相反,我添加stderr="true"的存在于phpunit.xml PHPUnit的标签选项,它的工作。 奇怪。

感谢Ian Bytchek的时间和精力。 :)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM