I'm trying to get my code coverage report to cover all of my laravel application code ( Controllers and Models ). For some reason it is only covering one test. Is there something wrong with this configuration below?
<phpunit colors="true"
bootstrap="/Users/bob/projects/leonardo2/laravel/cli/tasks/test/phpunit.php"
backupGlobals="false">
<testsuites>
<testsuite name="Test Suite">
<directory suffix=".test.php">/Users/bob/projects/leonardo2/application/tests</directory>
</testsuite>
</testsuites>
<filter>
<blacklist>
<exclude>
<directory suffix=".test.php">/Users/bob/projects/leonardo2/application/tests</directory>
</exclude>
</blacklist>
<whitelist>
<exclude>
<directory suffix=".php">/Users/bob/projects/leonardo2/application/config</directory>
<directory suffix=".php">/Users/bob/projects/leonardo2/application/views</directory>
<directory suffix=".php">/Users/bob/projects/leonardo2/application/migrations</directory>
<directory suffix=".php">/Users/bob/projects/leonardo2/application/libraries</directory>
<directory suffix=".php">/Users/bob/projects/leonardo2/application/tasks</directory>
<directory suffix=".php">/Users/bob/projects/leonardo2/application/language</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./storage/work/report/" charset="UTF-8"
highlight="false" lowUpperBound="35" highLowerBound="70"/>
</logging>
</phpunit>
So much complex conditioning is not needed I guess. Just add the app directory in the whitelist under filter tag.
<filter>
<whitelist>
<directory suffix=".php">app/</directory>
</whitelist>
</filter>
follow this link for a better understanding. Add Code Coverage Report to Laravel Project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With