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.83k stars 374 forks source link

Unable to generate report with the legend of *Executed *Not Executed*Dead Code #999

Closed raine-alegnor closed 1 year ago

raine-alegnor commented 1 year ago

| Q
I am unable to generate the report with the format that have Executed Not Executed*Dead Code

[php-code-coverage 9.2.26] using [PHP 8.1.10] and [PHPUnit 9.6.8] Xdebug v3.2.1,

i am trying to generate the report to check the performance of laravel application creating a command. the command run well but i didnt get the report that i expected.

this is my laravel command code :

raine-alegnor commented 1 year ago
    $filter = new Filter;

    $filter->includeDirectory(base_path('app'));

    $driver = new Xdebug3Driver($filter);

    $coverage = new CodeCoverage($driver, $filter);

    $coverage->processUncoveredFiles(); // Enable processing of uncovered files
    $coverage->
    $coverage->start('coverage');

    // Run PHPUnit tests

    $coverage->stop();

    $htmlReport = new HtmlReport();
    $htmlReport->process($coverage, storage_path('app/public/code-coverage-report'));

    $this->line('');
    $this->line('Code coverage report generated.');

    $this->output->writeln('');
    $this->output->writeln('Done.');
sebastianbergmann commented 1 year ago

I do not understand what you are trying to report.

raine-alegnor commented 1 year ago

with the previous code i am genereting this report : https://prnt.sc/JXkW-OCOUdav

and i need this : https://prnt.sc/vWtZcaNaN3Cm

the app is on laravel and i want to get the second report @sebastianbergmann