-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No code coverage whereas it should have some #21
Comments
Could it be that phpunit.xml contains invalid configuration for what to include in/exclude from code coverage? |
Here is my phpunit.xml.dist file :
When I run my unit tests with phpunit, I get correct code coverage. Do you have some specific requirements for as phpunit configuration. I did not see any except having correct inclusions ... |
Sorry, I have no idea what may be wrong here. I'd recommend step-debugging. Maybe something has changed here: |
I ran into the same problem, but I was able to solve it by adding the <?xml version="1.0" encoding="utf-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<coverage>
<include>
<directory suffix=".php">source</directory>
</include>
</coverage>
<php>
<env name="XDEBUG_MODE" value="coverage"/>
</php>
<filter>
<whitelist>
<directory suffix=".php">source</directory>
</whitelist>
</filter>
</phpunit> |
In a fresh Docker container (alpine linux php-fpm 8.0) I executed the following commands :
With this procedure the tests results show no coverage at all !
Note that the problem that I encountered in #20 disappeared!
The application main controller:
One of the .cov produced files (I do not know if it may help?) :
The text was updated successfully, but these errors were encountered: