Skip to content

Unable to generate HTML report with 12.0.1 and Phive installation #6124

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

Closed
cyrilverloop opened this issue Feb 7, 2025 · 6 comments
Closed
Assignees
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) installation/phar status/waiting-for-feedback Waiting for feedback from original reporter type/bug Something is broken version/12 Something affects PHPUnit 12

Comments

@cyrilverloop
Copy link

Q A
PHPUnit version 12.0.1
PHP version 8.4.3 with Xdebug 3.4.1
Installation Method PHAR

Summary

I am unable to generate the HTML report with PHPUnit 12.0.1 installed through Phive.

Current behavior

The following error message appears :

"An error occurred inside PHPUnit.

Message: PHPUnitPHAR\SebastianBergmann\CodeCoverage\StaticAnalysis\CachingFileAnalyser::interfacesIn(): Return value must be of type array, null returned
Location: phar:///[...]/phpunit/php-code-coverage/StaticAnalysis/CachingFileAnalyser.php:66"

How to reproduce

1 - Installing PHPUnit through Phive;
2 - executing PHPUnit with a configuration file containing :

<coverage>
    <report>
        <html outputDirectory="phpunit/html" /> <!-- adding this line generates the error message -->
    </report>
</coverage>

With a Composer installation the report generates without error.

Expected behavior

To be able to generate the HTML report.

@cyrilverloop cyrilverloop added the type/bug Something is broken label Feb 7, 2025
@sebastianbergmann sebastianbergmann added status/waiting-for-feedback Waiting for feedback from original reporter feature/code-coverage Issues related to code coverage (but not php-code-coverage) installation/phar labels Feb 8, 2025
@sebastianbergmann
Copy link
Owner

Thank you for your report.

Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting.

Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.

@sebastianbergmann sebastianbergmann added the version/12 Something affects PHPUnit 12 label Feb 8, 2025
@sebastianbergmann sebastianbergmann self-assigned this Feb 8, 2025
@sebastianbergmann sebastianbergmann removed the status/waiting-for-feedback Waiting for feedback from original reporter label Feb 8, 2025
@sebastianbergmann
Copy link
Owner

Never mind, I am able to reproduce this. It has nothing to do with configuring code coverage report generation in phpunit.xml.

@sebastianbergmann
Copy link
Owner

Does deleting your project's .phpunit.cache directory (or the directory you configured in your XML configuration file using the cacheDirectory attribute) help?

@sebastianbergmann
Copy link
Owner

Please test whether the PHPUnit 12.0.2 PHAR solves this issue for you. Thank you!

@cyrilverloop
Copy link
Author

Hi,

Removing the cache from 11.5.7 and running my tests with 12.0.1 works.
Keeping the 11.5.7 cache and updating to 12.0.2 works also.

Thanks for the quick response.

@sebastianbergmann
Copy link
Owner

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) installation/phar status/waiting-for-feedback Waiting for feedback from original reporter type/bug Something is broken version/12 Something affects PHPUnit 12
Projects
None yet
Development

No branches or pull requests

2 participants