sebastianbergmann / php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.
BSD 3-Clause "New" or "Revised" License
8.76k stars 370 forks source link

[Coverage show n/a] #1027

Open HoangLongTrinh opened 6 months ago

HoangLongTrinh commented 6 months ago
Q A
php-code-coverage version 9.2.30
PHP version 8.1.27
Driver PCOV / Xdebug
PCOV version 1.0.11
Xdebug version 3.3.1
Installation Method Composer
Usage Method PHPUnit
PHPUnit version 9.6.15

this is my config phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit
    bootstrap="./Bootstrap.php"
    backupGlobals="false"
    colors="true"
    processIsolation="false"
    stopOnFailure="true"
    stopOnError="true"
    verbose="true"
    stderr="true">
    <testsuites>
        <testsuite name="test-cover">
            <directory suffix="test.php">./</directory>
            <exclude>./_ci_phpunit_test/</exclude>
        </testsuite>
    </testsuites>
    <coverage processUncoveredFiles="true" includeUncoveredFiles="true" pathCoverage="false" ignoreDeprecatedCodeUnits="true" disableCodeCoverageIgnore="true">
        <include>
            <directory suffix=".php">../controllers</directory>
            <directory suffix=".php">../models</directory>
            <directory suffix=".php">../services</directory>
        </include>
        <report>
            <html outputDirectory="build/coverage" lowUpperBound="80" highLowerBound="100"/>
            <text outputFile="build/logs/coverage.txt"/>
        </report>
    </coverage>

    <logging>
        <junit outputFile="build/logs/junit.xml"/>
    </logging>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="XDEBUG_MODE" value="coverage"/>
        <ini name="memory_limit" value="-1"/>
    </php>
</phpunit>

when a run a code coverage, i got same like picture :( I'm make sure 100% that the code runs through those functions, please help me @sebastianbergmann , thank you so much! image image

sebastianbergmann commented 6 months ago

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.