教你一步一步写一个phpunit testcase(18)
发表于:2017-06-01来源:叶左左作者:叶左左点击数:
标签:PHPUnit
= ./vendor/autoload.php verbose = true testsuite directory suffix = Test.php ./tests / directory / testsuite filter whitelist processUncoveredFilesFromWhitelist = true directory suffix = .php ./src /
=
"./vendor/autoload.php" verbose=
"true">
<testsuite>
<directory suffix="Test.php">./tests
</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src
</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./report" charset="UTF-8"/>
</logging>
</phpunit>
接着执行测试:
phpunit tests/EventTest.php
就可以在reports/下打开index.html或其他html页面,浏览code coverage分析的结果。
原文转自:http://www.jianshu.com/p/ba6829a6f3ec