Skip to content
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

Coverage calculation issue #794

Closed
dominikzogg opened this issue Aug 13, 2020 · 3 comments
Closed

Coverage calculation issue #794

dominikzogg opened this issue Aug 13, 2020 · 3 comments

Comments

@dominikzogg
Copy link

Q A
PHPUnit version 9.3.x
PHP version 7.4.9
Installation Method Composer

Summary

The coverage calculation seem to have changed with phpunit 9.3.x.
9 2
9 3

phpdbg -qrr vendor/bin/phpunit --testsuite=Unit --coverage-text --coverage-clover=build/phpunit/clover.xml --coverage-html=build/phpunit/coverage-html --coverage-xml=build/phpunit/coverage-xml --log-junit=build/phpunit/junit.xml --cache-result-file=build/phpunit/result.cache

This leads to issue with infection testing: infection/infection#1289

Current behavior

The line is not marked as covered, even when it is. (Same code worked until 9.2.x)

How to reproduce

Source: https://github.com/chubbyphp/chubbyphp-framework-skeleton/blob/master/app/ServiceFactory/Framework/RoutesFactory.php
Test: https://github.com/chubbyphp/chubbyphp-framework-skeleton/blob/master/tests/Unit/ServiceFactory/Framework/RoutesFactoryTest.php

Run the test:

phpdbg -qrr vendor/bin/phpunit --coverage-html=coverage tests/Unit/ServiceFactory/Framework/RoutesFactoryTest.php

open coverage/ServiceFactory/Framework/RoutesFactory.php.html

Expected behavior

That the missing line is marked as covered.

@sebastianbergmann sebastianbergmann transferred this issue from sebastianbergmann/phpunit Aug 13, 2020
@sebastianbergmann
Copy link
Owner

A lot has changed in php-code-coverage ^9. For instance, we no longer work around bugs etc. in the extensions that are used to collect code coverage data. PHPDBG is not up to par with Xdebug or PCOV. I will not invest any time in debugging issues related to PHPDBG.

Do you experience the same problem with PCOV 1.0.6 or Xdebug 2.9.6?

@dominikzogg
Copy link
Author

@sebastianbergmann will test it and keep you updated, thanks for the response

@sebastianbergmann sebastianbergmann changed the title Coverage calculation issue phpunit 9.3.x Coverage calculation issue Aug 13, 2020
@sebastianbergmann
Copy link
Owner

Duplicate of #793.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants