Closed joostdecock closed 6 years ago
What command did you run to get Undefined variable: app
?
I ran phpunit --coverage-text
but it may have been a problem in my environment for it seems to be resolved now.
Sorry.
Actually, I still get the same error when running composer test
or phpunit --coverage-html
I added processUncoveredFilesFromWhitelist=false
to phpunit configuration file to resolve the issue.
Running composer test
now will generate coverage at public/tests/coverage/
.
Thank you for bringing the issue to my attention.
Affected for me when set directory to ./app
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
This is work:
<blacklist>
<directory suffix=".php">./vendor</directory>
</blacklist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">.</directory>
</whitelist>
While the unit tests for this work out of the box, generating a code coverage report bails out with
Undefined variable: app
.A code coverage report is very handy when writing tests. It would be great if this too would work out of the box.