簡體   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