Skip to content

Instantly share code, notes, and snippets.

@vanduc1102
Created March 15, 2020 16:23
Show Gist options
  • Save vanduc1102/ba7dc4b99611529b5eda93785ceca6cb to your computer and use it in GitHub Desktop.
Save vanduc1102/ba7dc4b99611529b5eda93785ceca6cb to your computer and use it in GitHub Desktop.
PHP Unit Code Coverage Setup phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/TestHelper.php"
backupGlobals="false"
backupStaticAttributes="false"
verbose="true"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="true">
<testsuite name="Api">
<directory>./tests/api/ApiControllerTest.php</directory>
</testsuite>
<testsuite name="sample">
<directory>./tests/sam/AControllerTest.php</directory>
<directory>./tests/sample/BRepositoryTest.php</directory>
<directory>./tests/sample/RedeemControllerTest.php</directory>
<directory>./tests/sample/RedeemRepositoryTest.php</directory>
</testsuite>
<testsuite name="Service">
<directory>./tests/services/MongoServiceTest.php</directory>
</testsuite>
<testsuite name="Library">
<directory>./tests/library/MyLibraryTest.php</directory>
</testsuite>
<filter>
<blacklist>
<directory>./vendor</directory>
<directory>./public</directory>
<directory>./tests</directory>
</blacklist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory>./app/controllers</directory>
<directory>./app/repositories</directory>
<directory>./app/services</directory>
<directory>./app/library</directory>
<directory>./app/models</directory>
<exclude>
<directory>./public/</directory>
<directory>./vendor/</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./build/coverage" title="Api Portal"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment