我正在學習單元測試Zend Framework
應用程序的繩索。到目前爲止,我已經設置了PHPUnit
與Zend Framework
一起工作,並開始編寫一些簡單的測試用例。PHPUnit代碼覆蓋率
我的問題是,我想知道爲什麼Code Coverage
無法在我的phpunit.xml
中的日誌記錄標記中設置。
我沒有收到任何錯誤,但沒有生成覆蓋報告。
但是它的工作原理,當我運行phpunit --coverage <dir>
我的PHPUnit的記錄部分是如下:
<phpunit bootstrap="./application/bootstrap.php" colors="true">
<testsuite name="CI Test Suite">
<directory>./</directory>
</testsuite>
<testsuite name="Library Test Suite">
<directory>./library</directory>
</testsuite>
<filter>
<whitelist>
<directory suffix=".php">../application/</directory>
<exclude>
<directory suffix=".phtml">../application</directory>
<file>../application/Bootstrap.php</file>
<file>../application/controllers/ErrorController.php</file>
</exclude>
</whitelist>
<logging>
<log type="coverage-html" target="./log/report" charset="UTF-8" yui="true"
highlight="true" lowUpperBound="50" highLowerBound="80" />
<log type="testdox" target="./log/testdox.html" />
</logging>
</filter>
</phpunit>
之前任何人都遇到這個?那麼可能的問題是什麼?
我沒有將我的日誌記錄嵌套在過濾器中......可能會有點區別 – 2012-04-23 16:43:56