php - Haw to setting phpunit for cod coverage?
one text
My phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
verbose="true">
<testsuites>
<testsuite name="default">
<directory>tests\driver</directory>
</testsuite>
</testsuites>
<coverage cacheDirectory=".phpunit.cache/code-coverage"
processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<logging>
<log type="coverage-html" target="./log/report" lowUpperBound="35"
highLowerBound="70"/>
<log type="coverage-clover" target="./log/coverage.xml"/>
<log type="coverage-php" target="./log/coverage.serialized"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
<log type="testdox-html" target="./log/testdox.html"/>
</logging>
</phpunit>
But I always get wrong:
Warning: Incorrect filter configuration, code coverage will not be processed
Warning - The configuration file did not pass validation! The following problems have been detected:
Line 20:
- Element 'filter': This element is not expected.
Test results may not be as expected.
Source