Git Product home page Git Product logo

phpcov's Introduction

Latest Stable Version CI Status Type Coverage codecov

phpcov

phpcov is a command-line frontend for the php-code-coverage library.

Installation

This tool is distributed as a PHP Archive (PHAR):

$ wget https://phar.phpunit.de/phpcov.phar

$ php phpcov.phar --version

Using Phive is the recommended way for managing the tool dependencies of your project:

$ phive install phpcov

$ ./tools/phpcov --version

It is not recommended to use Composer to download and install this tool.

Usage

Executing a PHP script and generating code coverage in Clover XML format

$ phpcov execute --clover coverage.xml script.php
phpcov 8.1.0 by Sebastian Bergmann.

Generating code coverage report in Clover XML format ... done

Merging exported php-code-coverage objects stored in *.cov files

$ parallel --gnu :::                                                 \
    'phpunit --coverage-php /tmp/coverage/FooTest.cov tests/FooTest' \
    'phpunit --coverage-php /tmp/coverage/BarTest.cov tests/BarTest'
$ phpcov merge --clover /tmp/clover.xml /tmp/coverage
phpcov 8.1.0 by Sebastian Bergmann.

Generating code coverage report in Clover XML format ... done

Patch Coverage

$ git diff HEAD^1 > /tmp/patch.txt
$ phpunit --coverage-php /tmp/coverage.cov
$ phpcov patch-coverage --path-prefix /path/to/project /tmp/coverage.cov /tmp/patch.txt
phpcov 8.1.0 by Sebastian Bergmann.

1 / 2 changed executable lines covered (50.00%)

Changed executable lines that are not covered:

  Example.php:11

phpcov's People

Contributors

adrienbrault avatar alexanderilyin avatar alexislefebvre avatar bladeofsteel avatar bryanagee avatar burgov avatar buschjost avatar grahamcampbell avatar henriquemoody avatar hnesk avatar hpbuniat avatar jeroeny avatar kukulich avatar nicolascarpi avatar nyholm avatar remicollet avatar ruudk avatar samsonasik avatar sebastianbergmann avatar shrikeh avatar slamdunk avatar uyga avatar vpx avatar webysther avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phpcov's Issues

PHPUnit vs PHPCov coverage stats

To speed-up my tests, I decided to give a try to phpcov merge.
Until now, I was doing a PHPUnit test coverage on the entire application and now I split the tests depending on the directories. It comes out that the result isn't the same. It happens to be that even the number of methods and lines aren't equal!
It seems that PHPUnit counts only named functions, against PHPCov that counts named and anonymous functions. Regarding the lines, I have no clue for the difference.

I'm using PHPUnit 7.3.5 (installed via Composer) and PHPCov 5.0.0 (installed via Phar).

Here are the outputs:
PHPUnit:

Code Coverage Report:        
  2019-02-26 09:53:53        
                             
 Summary:                    
  Classes: 43.84% (32/73)    
  Methods: 75.66% (373/493)  
  Lines:   83.55% (2478/2966)

\AppBundle\Command::AppBundle\Command\AgentReinitPwdCommand
  Methods:  80.00% ( 4/ 5)   Lines:  95.95% ( 71/ 74)
\AppBundle\Command::AppBundle\Command\DatabaseVersionCommand
  Methods:  66.67% ( 2/ 3)   Lines:  43.75% (  7/ 16)
\AppBundle\Command::AppBundle\Command\HarpeLeaderUnitCommand
  Methods:  66.67% ( 2/ 3)   Lines:  22.92% ( 11/ 48)
\AppBundle\Command::AppBundle\Command\HarpePersonneFullCommand
  Methods:  25.00% ( 2/ 8)   Lines:  28.21% ( 11/ 39)
\AppBundle\Command::AppBundle\Command\HarpeStructureFullCommand
  Methods:  25.00% ( 2/ 8)   Lines:  18.03% ( 11/ 61)
\AppBundle\Command::AppBundle\Command\ImportAffaireCommand
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 49/ 49)
\AppBundle\Command::AppBundle\Command\ImportCommand
  Methods:  66.67% ( 2/ 3)   Lines:  65.67% ( 44/ 67)
\AppBundle\Controller::AppBundle\Controller\AffaireController
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 56/ 56)
\AppBundle\Controller::AppBundle\Controller\AgentController
  Methods:  71.43% ( 5/ 7)   Lines:  96.20% ( 76/ 79)
\AppBundle\Controller::AppBundle\Controller\AttributController
  Methods:  83.33% ( 5/ 6)   Lines:  80.77% ( 42/ 52)
\AppBundle\Controller::AppBundle\Controller\ContractController
  Methods:  85.71% ( 6/ 7)   Lines:  97.06% ( 66/ 68)
\AppBundle\Controller::AppBundle\Controller\DashboardController
  Methods:  71.43% ( 5/ 7)   Lines:  99.19% (245/247)
\AppBundle\Controller::AppBundle\Controller\ImportController
  Methods:   0.00% ( 0/ 3)   Lines:  21.74% ( 10/ 46)
\AppBundle\Controller::AppBundle\Controller\IndicatorController
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 61/ 61)
\AppBundle\Controller::AppBundle\Controller\TeamController
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 85/ 85)
\AppBundle\Controller::AppBundle\Controller\UnitController
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 88/ 88)
\AppBundle\Entity::AppBundle\Entity\Activity
  Methods:  35.71% ( 5/14)   Lines:  50.00% ( 13/ 26)
\AppBundle\Entity::AppBundle\Entity\Affaire
  Methods:  76.47% (13/17)   Lines:  84.21% ( 32/ 38)
\AppBundle\Entity::AppBundle\Entity\Agent
  Methods:  93.33% (42/45)   Lines:  97.27% (178/183)
\AppBundle\Entity::AppBundle\Entity\AgentTeam
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\AgentUnit
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\Attribut
  Methods:  82.61% (19/23)   Lines:  85.11% ( 40/ 47)
\AppBundle\Entity::AppBundle\Entity\Contract
  Methods:  63.64% (21/33)   Lines:  77.78% ( 70/ 90)
\AppBundle\Entity::AppBundle\Entity\Import
  Methods:  55.56% (10/18)   Lines:  66.67% ( 20/ 30)
\AppBundle\Entity::AppBundle\Entity\Indicator
  Methods:  84.62% (11/13)   Lines:  82.14% ( 23/ 28)
\AppBundle\Entity::AppBundle\Entity\LeaderTeam
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\LeaderUnit
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\Team
  Methods:  88.46% (23/26)   Lines:  82.09% ( 55/ 67)
\AppBundle\Entity::AppBundle\Entity\Unit
  Methods:  83.33% (20/24)   Lines:  84.00% ( 42/ 50)
\AppBundle\Form::AppBundle\Form\AddAgentToTeamType
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 13/ 13)
\AppBundle\Form::AppBundle\Form\AffaireEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
\AppBundle\Form::AppBundle\Form\AffaireType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)
\AppBundle\Form::AppBundle\Form\AgentType
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 16/ 16)
\AppBundle\Form::AppBundle\Form\AttributEditInIndicatorType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  7/  7)
\AppBundle\Form::AppBundle\Form\AttributInIndicatorType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)
\AppBundle\Form::AppBundle\Form\AttributType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 12/ 12)
\AppBundle\Form::AppBundle\Form\ContractEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  5/  5)
\AppBundle\Form::AppBundle\Form\ContractType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 26/ 26)
\AppBundle\Form::AppBundle\Form\DashboardInstantType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 37/ 37)
\AppBundle\Form::AppBundle\Form\DashboardType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 41/ 41)
\AppBundle\Form::AppBundle\Form\ImportAffaireType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)
\AppBundle\Form::AppBundle\Form\IndicateurEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  7/  7)
\AppBundle\Form::AppBundle\Form\IndicateurType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 11/ 11)
\AppBundle\Form::AppBundle\Form\TeamEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
\AppBundle\Form::AppBundle\Form\TeamType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 27/ 27)
\AppBundle\Form::AppBundle\Form\UniteEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
\AppBundle\Form::AppBundle\Form\UniteType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 16/ 16)
\AppBundle\Form\EventListener::AppBundle\Form\EventListener\AgentListFieldSubscriber
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 14/ 14)
\AppBundle\Form\EventListener::AppBundle\Form\EventListener\ParentAttributeListFieldSubscriber
  Methods:  50.00% ( 1/ 2)   Lines:  92.31% ( 12/ 13)
\AppBundle\Form\EventListener::AppBundle\Form\EventListener\RoleListFieldSubscriber
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 13/ 13)
\AppBundle\Manager::AppBundle\Manager\HarpePersonneManager
  Methods:  87.50% (14/16)   Lines:  91.37% (127/139)
\AppBundle\Manager::AppBundle\Manager\TeamManager
  Methods:  75.00% ( 6/ 8)   Lines:  78.57% ( 22/ 28)
\AppBundle\Manager::AppBundle\Manager\UnitManager
  Methods:  66.67% ( 6/ 9)   Lines:  68.75% ( 22/ 32)
\AppBundle\Menu::AppBundle\Menu\MenuBuilder
  Methods:  50.00% ( 1/ 2)   Lines:  97.30% ( 36/ 37)
\AppBundle\Model::AppBundle\Model\AgentAssociation
  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 13/ 13)
\AppBundle\Repository::AppBundle\Repository\ActivityRepository
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 81/ 81)
\AppBundle\Repository::AppBundle\Repository\AffaireRepository
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 26/ 26)
\AppBundle\Repository::AppBundle\Repository\AgentRepository
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 89/ 89)
\AppBundle\Repository::AppBundle\Repository\AttributRepository
  Methods:  80.00% ( 4/ 5)   Lines:  96.72% ( 59/ 61)
\AppBundle\Repository::AppBundle\Repository\ContractRepository
  Methods:  71.43% ( 5/ 7)   Lines:  82.50% ( 99/120)
\AppBundle\Repository::AppBundle\Repository\ImportRepository
  Methods:  25.00% ( 1/ 4)   Lines:  32.43% ( 12/ 37)
\AppBundle\Repository::AppBundle\Repository\IndicatorRepository
  Methods:  80.00% ( 4/ 5)   Lines:  91.43% ( 32/ 35)
\AppBundle\Repository::AppBundle\Repository\ParamRepository
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  8/  8)
\AppBundle\Repository::AppBundle\Repository\TeamRepository
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 43/ 43)
\AppBundle\Repository::AppBundle\Repository\UnitRepository
  Methods:  66.67% ( 6/ 9)   Lines:  57.41% ( 62/108)
\AppBundle\Utils::AppBundle\Utils\DateUtils
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 18/ 18)

PHPCov:

Code Coverage Report:        
  2019-02-26 13:18:54        
                             
 Summary:                    
  Classes: 43.84% (32/73)    
  Methods: 76.60% (396/517)  
  Lines:   83.55% (2478/2966)

\AppBundle\Command::AppBundle\Command\AgentReinitPwdCommand
  Methods:  80.00% ( 4/ 5)   Lines:  95.95% ( 71/ 74)
\AppBundle\Command::AppBundle\Command\DatabaseVersionCommand
  Methods:  66.67% ( 2/ 3)   Lines:  43.75% (  7/ 16)
\AppBundle\Command::AppBundle\Command\HarpeLeaderUnitCommand
  Methods:  66.67% ( 2/ 3)   Lines:  22.92% ( 11/ 48)
\AppBundle\Command::AppBundle\Command\HarpePersonneFullCommand
  Methods:  25.00% ( 2/ 8)   Lines:  28.21% ( 11/ 39)
\AppBundle\Command::AppBundle\Command\HarpeStructureFullCommand
  Methods:  25.00% ( 2/ 8)   Lines:  18.03% ( 11/ 61)
\AppBundle\Command::AppBundle\Command\ImportAffaireCommand
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 34/ 34)
\AppBundle\Command::AppBundle\Command\ImportCommand
  Methods:  60.00% ( 3/ 5)   Lines:  57.14% ( 28/ 49)
\AppBundle\Controller::AppBundle\Controller\AffaireController
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 56/ 56)
\AppBundle\Controller::AppBundle\Controller\AgentController
  Methods:  71.43% ( 5/ 7)   Lines:  96.20% ( 76/ 79)
\AppBundle\Controller::AppBundle\Controller\AttributController
  Methods:  83.33% ( 5/ 6)   Lines:  80.77% ( 42/ 52)
\AppBundle\Controller::AppBundle\Controller\ContractController
  Methods:  85.71% ( 6/ 7)   Lines:  97.06% ( 66/ 68)
\AppBundle\Controller::AppBundle\Controller\DashboardController
  Methods:  77.78% ( 7/ 9)   Lines:  99.19% (244/246)
\AppBundle\Controller::AppBundle\Controller\ImportController
  Methods:   0.00% ( 0/ 3)   Lines:  21.74% ( 10/ 46)
\AppBundle\Controller::AppBundle\Controller\IndicatorController
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 61/ 61)
\AppBundle\Controller::AppBundle\Controller\TeamController
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 85/ 85)
\AppBundle\Controller::AppBundle\Controller\UnitController
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 88/ 88)
\AppBundle\Entity::AppBundle\Entity\Activity
  Methods:  35.71% ( 5/14)   Lines:  50.00% ( 13/ 26)
\AppBundle\Entity::AppBundle\Entity\Affaire
  Methods:  76.47% (13/17)   Lines:  84.21% ( 32/ 38)
\AppBundle\Entity::AppBundle\Entity\Agent
  Methods:  93.33% (42/45)   Lines:  97.27% (178/183)
\AppBundle\Entity::AppBundle\Entity\AgentTeam
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\AgentUnit
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\Attribut
  Methods:  82.61% (19/23)   Lines:  85.11% ( 40/ 47)
\AppBundle\Entity::AppBundle\Entity\Contract
  Methods:  65.71% (23/35)   Lines:  76.19% ( 64/ 84)
\AppBundle\Entity::AppBundle\Entity\Import
  Methods:  55.56% (10/18)   Lines:  66.67% ( 20/ 30)
\AppBundle\Entity::AppBundle\Entity\Indicator
  Methods:  84.62% (11/13)   Lines:  82.14% ( 23/ 28)
\AppBundle\Entity::AppBundle\Entity\LeaderTeam
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\LeaderUnit
  Methods:  75.00% ( 3/ 4)   Lines:  87.50% (  7/  8)
\AppBundle\Entity::AppBundle\Entity\Team
  Methods:  88.46% (23/26)   Lines:  82.09% ( 55/ 67)
\AppBundle\Entity::AppBundle\Entity\Unit
  Methods:  83.33% (20/24)   Lines:  84.00% ( 42/ 50)
\AppBundle\Form::AppBundle\Form\AddAgentToTeamType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  6/  6)
\AppBundle\Form::AppBundle\Form\AffaireEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
\AppBundle\Form::AppBundle\Form\AffaireType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)
\AppBundle\Form::AppBundle\Form\AgentType
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 16/ 16)
\AppBundle\Form::AppBundle\Form\AttributEditInIndicatorType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  7/  7)
\AppBundle\Form::AppBundle\Form\AttributInIndicatorType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)
\AppBundle\Form::AppBundle\Form\AttributType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 12/ 12)
\AppBundle\Form::AppBundle\Form\ContractEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  5/  5)
\AppBundle\Form::AppBundle\Form\ContractType
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 18/ 18)
\AppBundle\Form::AppBundle\Form\DashboardInstantType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 37/ 37)
\AppBundle\Form::AppBundle\Form\DashboardType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 41/ 41)
\AppBundle\Form::AppBundle\Form\ImportAffaireType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)
\AppBundle\Form::AppBundle\Form\IndicateurEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  7/  7)
\AppBundle\Form::AppBundle\Form\IndicateurType
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 11/ 11)
\AppBundle\Form::AppBundle\Form\TeamEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
\AppBundle\Form::AppBundle\Form\TeamType
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 21/ 21)
\AppBundle\Form::AppBundle\Form\UniteEditType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
\AppBundle\Form::AppBundle\Form\UniteType
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 12/ 12)
\AppBundle\Form\EventListener::AppBundle\Form\EventListener\AgentListFieldSubscriber
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 11/ 11)
\AppBundle\Form\EventListener::AppBundle\Form\EventListener\ParentAttributeListFieldSubscriber
  Methods:  80.00% ( 4/ 5)   Lines:  90.00% (  9/ 10)
\AppBundle\Form\EventListener::AppBundle\Form\EventListener\RoleListFieldSubscriber
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 13/ 13)
\AppBundle\Manager::AppBundle\Manager\HarpePersonneManager
  Methods:  87.50% (14/16)   Lines:  91.37% (127/139)
\AppBundle\Manager::AppBundle\Manager\TeamManager
  Methods:  75.00% ( 6/ 8)   Lines:  78.57% ( 22/ 28)
\AppBundle\Manager::AppBundle\Manager\UnitManager
  Methods:  66.67% ( 6/ 9)   Lines:  68.75% ( 22/ 32)
\AppBundle\Menu::AppBundle\Menu\MenuBuilder
  Methods:  50.00% ( 1/ 2)   Lines:  97.30% ( 36/ 37)
\AppBundle\Model::AppBundle\Model\AgentAssociation
  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 13/ 13)
\AppBundle\Repository::AppBundle\Repository\ActivityRepository
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 81/ 81)
\AppBundle\Repository::AppBundle\Repository\AffaireRepository
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 26/ 26)
\AppBundle\Repository::AppBundle\Repository\AgentRepository
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 89/ 89)
\AppBundle\Repository::AppBundle\Repository\AttributRepository
  Methods:  80.00% ( 4/ 5)   Lines:  96.72% ( 59/ 61)
\AppBundle\Repository::AppBundle\Repository\ContractRepository
  Methods:  71.43% ( 5/ 7)   Lines:  82.50% ( 99/120)
\AppBundle\Repository::AppBundle\Repository\ImportRepository
  Methods:  25.00% ( 1/ 4)   Lines:  32.43% ( 12/ 37)
\AppBundle\Repository::AppBundle\Repository\IndicatorRepository
  Methods:  80.00% ( 4/ 5)   Lines:  91.43% ( 32/ 35)
\AppBundle\Repository::AppBundle\Repository\ParamRepository
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  8/  8)
\AppBundle\Repository::AppBundle\Repository\TeamRepository
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 43/ 43)
\AppBundle\Repository::AppBundle\Repository\UnitRepository
  Methods:  66.67% ( 6/ 9)   Lines:  57.41% ( 62/108)
\AppBundle\Utils::AppBundle\Utils\DateUtils
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 18/ 18)

HTML Line Coverage after Merge showing function variables as lines to be covered

Apologies for all the screenshots, but I believe it to be the best way to provide you with the information.

Basically, after a merge, lines that were showing correctly as not to be covered, were showing as lines that should be and weren't touched.

This is using the output from Codeception Coverage Reports.

Before Merge: Before Merge

Before Merge

Before Merge

After Merge: After Merge

After Merge

After Merge

The number of lines in the class expands also which compounds the loss of line coverage.

Can phpcov with the 'execute' option handle arguments to the script?

I have a command that I normally run like this:

php console rabbitmq:consumer -m 50 -w search_events -e=prod

I would like to execute that script and pass it arguments, using phpcov. Is that possible? From my own experiments it seems like phpcov will just reject the additional arguments as not valid, but maybe I am missing something.

Verify coverage

I had an idea, how about adding a command that verifies code coverage? You could read an .cov file, extract the coverage percentage, compare it to a given target and then exit with either 0 or 1.

If I had the time I'd build it myself :) Maybe on the AmsterdamPHP/DPC Codenight next month...

Tag version for PHPUnit 3.7.x

Is there possibility to create tag for phpcov that depends on PHPUnit 3.7.*?

It would be nice to have a tag for those who can't/don't want use the 4.0.x@dev version yet.

How to use 'execute'?

Hi, i'm confused about how to use the execute command:

<?php
// TestClass.php
class TestClass
{
    public function method1()
    {
        echo "method 1 triggered";
    }

    public function method2()
    {
        echo "method 2 triggered";
        return 'yeehaa';
    }
}

script:

<?php
//script.php
require_once 'TestClass.php';

$testClass = new TestClass();
$testClass->method1();

then i fire phpcov execute script.php --clover coverage.xml and the contents of the clover file is:

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1497445956">
  <project timestamp="1497445956">
    <metrics files="0" loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
  </project>
</coverage>

i expected that method 1 will be covered..what am i missing here?

Tests not passing

Could you set the project in travis?

the tests are not passing:

PHPUnit 4.5.0 by Sebastian Bergmann and contributors.

F

Time: 45 ms, Memory: 3.50Mb

There was 1 failure:

1) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/Users/felix/phpcov/tests/PatchCoverageTest.php:41

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

Feature Request: output xml like --covarage-xml in phpunit does

It would be very useful to be able to use phpcov to output the files and directory structure that are created when phpunit is run with the --coverage-xml. For instance, phpdox uses that structure to enrich its output but it cannot enrich with multiple directories which is necessary if a project consists of multiple phpunit runs and then merging of the various bits of output into their individual reports.

phpcov silently failing

I'm running this:
php -d memory_limit=-1 vendor/bin/phpcov merge ~/coverage --html ~/coverage_merge

And getting the following output:

phpcov 3.1.0 by Sebastian Bergmann.

Killed

The ~/coverage folder has these 16 files generated by phpunit with --coverage-php option:
coverage_report_0.cov coverage_report_10.cov coverage_report_12.cov coverage_report_14.cov coverage_report_2.cov coverage_report_4.cov coverage_report_6.cov coverage_report_8.cov
coverage_report_1.cov coverage_report_11.cov coverage_report_13.cov coverage_report_15.cov coverage_report_3.cov coverage_report_5.cov coverage_report_7.cov coverage_report_9.cov

Missing "--configuration" option for "merge" command

At this moment, the merge command has no configuration option (execute does). I thought about submitting it as a PR (shouldn't be a difficult one), but maybe I'm missing a reason for not doing so. Please let me know if it's a good idea to work on this :)

Support for Phpunit 6.3.0

It seems that Phpunit 6.3.0 has following dependecy "sebastian/diff": "^2.0" and this phpcov requires "sebastian/diff": "^1.1"

Executing merge command outputs empty coverage

Problem:
The files I want to merge are not being merged. The resulting file is empty, but no errors are shown.

Description:
I have setup my environment to run phpcov inside a docker container (named coverage-merger). I assume the setup was successful because when I run the command below, no errors are shown.

/vendor/bin/phpcov merge /app/tool/files_to_merge --clover /app/tool/result/clover.xml

output:

coverage-merger    | phpcov 5.0.0 by Sebastian Bergmann.
coverage-merger    |
coverage-merger    |
coverage-merger    | Generating code coverage report in Clover XML format ... done

However, I have 2 files in the /files_to_merge directory, and they are not being merged. A resulting file is generated, but the metrics are shown as 0 (it has no content from the original files).

Both files in the /files_to_merge directory were generated from tests using phpunit with the
--coverage-php option enabled. The files are .cov and have php content inside.

I have tried generating the output in html and xml formats, but both of them generate empty results.
Is there something I'm missing? I have attached the target files and the result for reference.

Target files:
phpcov1.txt
phpcov2.txt

Result:
clover.txt

Versions
PHP 7.2.10
PHPUnit 6.5.13
phpcov 5.0.0
Docker 18.03

Symfony components loading

When you run phpcov --merge you get such error:

$ /Users/alexanderilyin/github.com/badoo/phpcov/phpcov.php --merge --whitelist ./dir/file1.php --whitelist ./dir/file2.php --html ~/coverage/html ~/coverage/php
phpcov @package_version@ by Sebastian Bergmann.


Fatal error: Class 'Symfony\Component\Finder\Finder' not found in /Users/alexanderilyin/github.com/badoo/phpcov/PHP/CodeCoverage/TextUI/Command.php on line 230

Call Stack:
    0.0002     645904   1. {main}() /Users/alexanderilyin/github.com/badoo/phpcov/phpcov.php:0
    0.0019    1003880   2. PHP_CodeCoverage_TextUI_Command::main() /Users/alexanderilyin/github.com/badoo/phpcov/phpcov.php:64

Current include path

$ php -i | grep include_path
include_path => .:/Users/alexanderilyin/pear/share/pear => .:/Users/alexanderilyin/pear/share/pear

Installed packages:

$ ~/pear/bin/pear list -c phpunit
Installed packages, channel pear.phpunit.de:
============================================
Package          Version State
File_Iterator    1.3.3   stable
PHP_CodeCoverage 1.2.6   stable
PHP_TokenStream  1.1.5   stable
Text_Template    1.1.3   stable
phpcov           1.0.0   stable

$ ~/pear/bin/pear list -c symfony
Installed packages, channel pear.symfony-project.com:
=====================================================
Package Version State
YAML    1.0.6   stable

$ ~/pear/bin/pear list -c symfony2
Installed packages, channel pear.symfony.com:
=============================================
Package Version State
Finder  2.1.3   stable

So there should be added some autoload or Finder's library should be included file by file like in https://github.com/sebastianbergmann/finder-facade/blob/master/src/autoload.php

Which version will work with phpunit 6.5.12?

I'm trying to set up phpcov to work with phpunit 6.5.12 but, no matter which version I try, it seems to fail.

I'm limited to 6.5 because I'm running unit and integration tests on a WordPress plugin, and apparently WordPress only works with v 6.5 :/

merging coverage files generated with codeception

Problem:

I use codeception for acceptance (with Selenium) and local unit tests.
I want to merge remote coverage with local.
The 2 generated reports make references to the same files (identical paths and namespaces), however, codeception does not merge them.

So I'm trying to use phpcov...

I use the --coverage option to produce serialized format files

codecept run --coverage

The 2 generated files are:

  • coverage.serialized in the _output local folder
  • codecoverage.serializedin the _output/c3tmp remote folder on the web server
    I copy the remote file in the same folder (tests/_output) that the local and execute:
./vendor/bin/phpcov merge tests/_output/ --clover tests/_output/coverage-all.xml

Console output:

phpcov 5.0.0 by Sebastian Bergmann.
Generating code coverage report in Clover XML format ... done

No error, but the generated file is empty:

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1548805986">
  <project timestamp="1548805986">
    <metrics files="0" loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
  </project>
</coverage>

phpcov is it compatible with codeception and the serialized format as some say? see Codeception/Codeception#3245 (comment)

configuration

  • phpcov version: 5.0.0
  • Codeception version: 2.5.2
  • PHPUnit: 7.5.2
  • PHP Version: 7.2.13
  • Operating System: Debian ? (Scrutinizer-ci)
  • Installation type: Composer

Patch Coverage

Given a serialized PHP_CodeCoverage object and a diff (produced by git diff HEAD^1, for instance), the phpcov CLI tool should be able to figure out whether all changed/new lines are covered.

cannot merge multiple .cov files

I run merge command
./phpcov merge c:/inetpub/wwwroot/ccn/reports/coverage --clover tmp/clover.xml
and get following error.
Generating code coverage report in Clover XML format ... done
Failed to merge: C:\inetpub\wwwroot\ccn\reports\coverage\590f7c0fe27b2.cov
Failed to merge: C:\inetpub\wwwroot\ccn\reports\coverage\590f7cbc2f7e5.cov
attach these 2 files.
590f7cbc2f7e5.txt
590f7c0fe27b2.txt

phpcov should mask its arguments from script that is being executed

Given following simple script

<?php

use Symfony\Component\Console\Output\OutputInterface;

require_once __DIR__.'/../vendor/autoload.php';

(new \Symfony\Component\Console\Application())
    ->register('greeter')
    ->addArgument('message', null, 'world')
    ->setCode(function(\Symfony\Component\Console\Input\InputInterface $input, OutputInterface $output) {
        $output->writeln('hello ' . $input->getArgument('message'));
    })
    ->getApplication()
    ->setDefaultCommand('greeter', true)
    ->run()
;

When phpcov executes it via phpcov execute greeter.php
Then script should output hello, not

Too many arguments, expected arguments "message".

Merged clover.xml all 0's

Running phpcov merge Certification.cov --clover clover.xml

Results in:

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1531785321">
  <project timestamp="1531785321">
    <metrics files="0" loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
  </project>
</coverage>

Even though my ./var/coverage/Certification.cov has data in it (truncated here):

<?php return unserialize('O:43:"SebastianBergmann\\CodeCoverage\\CodeCoverage":20:{s:51:"' . "\0" . 'SebastianBergmann\\CodeCoverage\\CodeCoverage' . "\0" . 'driver";O:44:"SebastianBergmann\\CodeCoverage\\Driver\\Xdebug":1:{s:59:"' . "\0" . 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug' . "\0" . 'cacheNumLines";a:1281:{s:48:"/var/www/app/vendor/composer/autoload_static.php";i:1729;s:58:"/var/www/app/vendor/paragonie/random_compat/lib/random.php";i:225;s:78:"/var/www/app/vendor/behat/gherkin/src/Behat/Gherkin/Keywords/ArrayKeywords.php";i:200;s:67:"/var/www/app/vendor/zendframework/zend-stdlib/src/PriorityQueue.php";i:301;s:78:"/var/www/app/vendor/symfony/config/Definition/Builder/NormalizationBuilder.php";i:60;s:72:"/var/www/app/vendor/symfony/dependency-injection/Compiler/PassConfig.php";i:270;s:82:"/var/www/app/vendor/symfony/dependency-injection/Compiler/DecoratorServicePass.php";i:68;s:81:"/var/www/app/vendor/symfony/dependency-injection/Compiler/ResolvePrivatesPass.php";i:40;s:80:"/var/www/app/vendor/symfony/dependency-injection/Compiler/ResolveHotPathPass.php";i:71;s:61:"/var/www/app/vendor/symfony/translation/Loader/FileLoader.php";i:65;s:51:"/var/www/app/vendor/ppito/zf3-whoops/src/Module.php";i:179;s:67:"/var/www/app/vendor/zendframework/zend-cache/src/ConfigProvider.php";i:42;s:84:"/var/www/app/vendor/zendframework/zend-mvc/src/Service/HttpMethodListenerFactory.php";i:40;s:91:"/var/www/app/vendor/zendframework/zend-mvc/src/Service/HttpRouteNotFoundStrategyFactory.php";i:73;s:64:"/var/www/app/vendor/filp/whoops/src/Whoops/Util/SystemFacade.php";i:137;s:88:"/var/www/app/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Event/AfterStepSetup.php";i:95;s:89:"/var/www/app/vendor/doctrine/doctrine-module/src/DoctrineModule/Service/DriverFactory.php";i:128;s:76:"/var/www/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeTzType.php";i:97;s:72:"/var/www/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BinaryType.php";i:84;s:78:...

PHP 7.2.3
PHPUnit version 6.5.9
PHPCov version 4.0.5
php-code-coverage 5.3.2
XDebug 2.6.0

No additional output from -vvv

Text coverage broken under phpcov 3.0.1

Hello,

Are you able to apply the patch which fixed text coverage in 3.1.0 to the 3.0 branch?
d1cac84

I'm not currently able to update to 3.1.0. It's dependency on php-code-coverage 4.x is causing me a bit of headaches on non-namespaced files in laravel, namely the routes file. I'm working to solve that issue, but in the meantime if you'd be able to backport this fix to 3.0 it would be greatly appreciated.

I can confirm that manually applying the commit fixes the issues I am experiencing with phpcov not outputting anything for text coverage.

Thanks!

Different line coverage report result

Thank you PHPCOV.
It is good tool to merge from separated coverage report results to one.
I am merging of from three PHPUnit coverage results to one result by PHPCov.
Some line coverage reports are different.

[PHPCov]
PHPCov

[PHPUnit]
PHPUnit

Thank you.

Broken tests

After finally (sorry!) merging the pull requests sent by @bryanagee, @MajorCaiger, @fatalcoder, and @vpx, there are now failing tests:

PHPUnit 4.8.19 by Sebastian Bergmann and contributors.

FFF

Time: 40 ms, Memory: 4.00Mb

There were 3 failures:

1) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly with data set #0 ('patch')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/usr/local/src/phpcov/tests/PatchCoverageTest.php:38

2) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly with data set #1 ('patch2')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/usr/local/src/phpcov/tests/PatchCoverageTest.php:38

3) SebastianBergmann\PHPCOV\PatchCoverageTest::testPatchCoverageIsCalculatedCorrectly with data set #2 ('patch3')
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'numChangedLinesThatAreExecutable' => 2
-    'numChangedLinesThatWereExecuted' => 1
+    'numChangedLinesThatAreExecutable' => 0
+    'numChangedLinesThatWereExecuted' => 0
     'changedLinesThatWereNotExecuted' => Array (
-        'Example.php' => Array (...)
     )
 )

/usr/local/src/phpcov/tests/PatchCoverageTest.php:38

FAILURES!
Tests: 3, Assertions: 3, Failures: 3.

PHPUnit 7 conflicts with phpcov 4.0.5 because of sebastian/diff

Q A
PHPUnit version 7.0.0
PHP version 7.1.8
Installation Method Composer

I'm trying to update to phpunit 7 in my project, which also requires phpcov, but it throws an error because they both require the package sebastian/diff in different versions.

phpcov 4.0.5 requires version ^1.0 || ^2.0, while phpunit 7.0.0 requires version ^3.0.

Incorrect version info

I have installed latest release 7.0.0 and if I run phpcov --version command I get following:

root@d4e44b35ab13:/app# phpcov --version
phpcov 6.0.1 by Sebastian Bergmann.

Seems like the cause for this is this line.

Readme is not up-to-date

For example, the merge option usage (as indicated by phpcov --help) should read

-phpcov merge --clover coverage.xml /home/sb/example
+phpcov --merge --clover coverage.xml /home/sb/example

There seems to be other differences between the documentation and phpcov, but I just found the tool and know nothing about it.

"Uncaught Error: Class not found" when running with --xml flag

While phpcov works great with the -- clover and the --html flag, I'm experiencing the following error when running phpcov with the --xml flag:

Generating code coverage report in PHP format ...PHP Fatal error:  Uncaught Error: Class 'TheSeer\Tokenizer\Tokenizer' not found in phar:///opt/phpcov/phpcov.phar/phpunit/php-code-coverage/src/Report/Xml/Source.php:37
Stack trace:
#0 phar:///opt/phpcov/phpcov.phar/phpunit/php-code-coverage/src/Report/Xml/Facade.php(165): SebastianBergmann\CodeCoverage\Report\Xml\Source->setSourceCode('<?php\n\nnamespac...')
#1 phar:///opt/phpcov/phpcov.phar/phpunit/php-code-coverage/src/Report/Xml/Facade.php(121): SebastianBergmann\CodeCoverage\Report\Xml\Facade->processFile(Object(SebastianBergmann\CodeCoverage\Node\File), Object(SebastianBergmann\CodeCoverage\Report\Xml\Directory))
#2 phar:///opt/phpcov/phpcov.phar/phpunit/php-code-coverage/src/Report/Xml/Facade.php(117): SebastianBergmann\CodeCoverage\Report\Xml\Facade->processDirectory(Object(SebastianBergmann\CodeCoverage\Node\Directory), Object(SebastianBergmann\CodeCoverage\Report\Xml\Directory))
#3 phar:///opt/phpcov/phpcov.phar/phpunit/php-code-coverage/src/Report/Xml/Facade.php(117): SebastianBergmann\CodeCoverage\Report\Xml\Facade in phar:///opt/phpcov/phpcov.phar/phpunit/php-code-coverage/src/Report/Xml/Source.php on line 37

Unable to install phpunit/phpcov v6 using Laravel 7 & PHP ^7.2.5

This is the ouput:

Using version ^6.0 for phpunit/phpcov
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install phpunit/phpcov 6.0.1
    - Conclusion: remove symfony/console v5.0.5
    - Installation request for phpunit/phpcov ^6.0 -> satisfiable by phpunit/phpcov[6.0.0, 6.0.1].
    - Conclusion: don't install symfony/console v5.0.5
    - phpunit/phpcov 6.0.0 requires symfony/console ^3.0 || ^4.0 -> satisfiable by symfony/console[3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, 4.0.x-dev, 4.1.x-dev, 4.2.x-dev, 4.3.x-dev, 4.4.x-dev, v3.0.0, v3.0.0-BETA1, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.0-BETA1, v3.1.0-RC1, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.0-BETA1, v3.2.0-RC1, v3.2.0-RC2, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.0-BETA1, v3.3.0-RC1, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.17, v3.3.18, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16, v3.4.17, v3.4.18, v3.4.19, v3.4.2, v3.4.20, v3.4.21, v3.4.22, v3.4.23, v3.4.24, v3.4.25, v3.4.26, v3.4.27, v3.4.28, v3.4.29, v3.4.3, v3.4.30, v3.4.31, v3.4.32, v3.4.33, v3.4.34, v3.4.35, v3.4.36, v3.4.37, v3.4.38, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9, v4.0.0, v4.0.0-BETA1, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.0-RC1, v4.0.0-RC2, v4.0.1, v4.0.10, v4.0.11, v4.0.12, v4.0.13, v4.0.14, v4.0.15, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.0-BETA1, v4.1.0-BETA2, v4.1.0-BETA3, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.0, v4.2.0-BETA1, v4.2.0-BETA2, v4.2.0-RC1, v4.2.1, v4.2.10, v4.2.11, v4.2.12, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.3.0, v4.3.0-BETA1, v4.3.0-BETA2, v4.3.0-RC1, v4.3.1, v4.3.10, v4.3.11, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1, v4.4.2, v4.4.3, v4.4.4, v4.4.5].
    - Can only install one of: symfony/console[3.0.x-dev, v5.0.5].
    - Can only install one of: symfony/console[3.1.x-dev, v5.0.5].
    - Can only install one of: symfony/console[3.2.x-dev, v5.0.5].
    - Can only install one of: symfony/console[3.3.x-dev, v5.0.5].
    - Can only install one of: symfony/console[3.4.x-dev, v5.0.5].
    - Can only install one of: symfony/console[4.0.x-dev, v5.0.5].
    - Can only install one of: symfony/console[4.1.x-dev, v5.0.5].
    - Can only install one of: symfony/console[4.2.x-dev, v5.0.5].
    - Can only install one of: symfony/console[4.3.x-dev, v5.0.5].
    - Can only install one of: symfony/console[4.4.x-dev, v5.0.5].
    - Can only install one of: symfony/console[v3.0.0, v5.0.5].
    - Can only install one of: symfony/console[v3.0.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v3.0.1, v5.0.5].
    - Can only install one of: symfony/console[v3.0.2, v5.0.5].
    - Can only install one of: symfony/console[v3.0.3, v5.0.5].
    - Can only install one of: symfony/console[v3.0.4, v5.0.5].
    - Can only install one of: symfony/console[v3.0.5, v5.0.5].
    - Can only install one of: symfony/console[v3.0.6, v5.0.5].
    - Can only install one of: symfony/console[v3.0.7, v5.0.5].
    - Can only install one of: symfony/console[v3.0.8, v5.0.5].
    - Can only install one of: symfony/console[v3.0.9, v5.0.5].
    - Can only install one of: symfony/console[v3.1.0, v5.0.5].
    - Can only install one of: symfony/console[v3.1.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v3.1.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v3.1.1, v5.0.5].
    - Can only install one of: symfony/console[v3.1.10, v5.0.5].
    - Can only install one of: symfony/console[v3.1.2, v5.0.5].
    - Can only install one of: symfony/console[v3.1.3, v5.0.5].
    - Can only install one of: symfony/console[v3.1.4, v5.0.5].
    - Can only install one of: symfony/console[v3.1.5, v5.0.5].
    - Can only install one of: symfony/console[v3.1.6, v5.0.5].
    - Can only install one of: symfony/console[v3.1.7, v5.0.5].
    - Can only install one of: symfony/console[v3.1.8, v5.0.5].
    - Can only install one of: symfony/console[v3.1.9, v5.0.5].
    - Can only install one of: symfony/console[v3.2.0, v5.0.5].
    - Can only install one of: symfony/console[v3.2.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v3.2.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v3.2.0-RC2, v5.0.5].
    - Can only install one of: symfony/console[v3.2.1, v5.0.5].
    - Can only install one of: symfony/console[v3.2.10, v5.0.5].
    - Can only install one of: symfony/console[v3.2.11, v5.0.5].
    - Can only install one of: symfony/console[v3.2.12, v5.0.5].
    - Can only install one of: symfony/console[v3.2.13, v5.0.5].
    - Can only install one of: symfony/console[v3.2.14, v5.0.5].
    - Can only install one of: symfony/console[v3.2.2, v5.0.5].
    - Can only install one of: symfony/console[v3.2.3, v5.0.5].
    - Can only install one of: symfony/console[v3.2.4, v5.0.5].
    - Can only install one of: symfony/console[v3.2.5, v5.0.5].
    - Can only install one of: symfony/console[v3.2.6, v5.0.5].
    - Can only install one of: symfony/console[v3.2.7, v5.0.5].
    - Can only install one of: symfony/console[v3.2.8, v5.0.5].
    - Can only install one of: symfony/console[v3.2.9, v5.0.5].
    - Can only install one of: symfony/console[v3.3.0, v5.0.5].
    - Can only install one of: symfony/console[v3.3.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v3.3.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v3.3.1, v5.0.5].
    - Can only install one of: symfony/console[v3.3.10, v5.0.5].
    - Can only install one of: symfony/console[v3.3.11, v5.0.5].
    - Can only install one of: symfony/console[v3.3.12, v5.0.5].
    - Can only install one of: symfony/console[v3.3.13, v5.0.5].
    - Can only install one of: symfony/console[v3.3.14, v5.0.5].
    - Can only install one of: symfony/console[v3.3.15, v5.0.5].
    - Can only install one of: symfony/console[v3.3.16, v5.0.5].
    - Can only install one of: symfony/console[v3.3.17, v5.0.5].
    - Can only install one of: symfony/console[v3.3.18, v5.0.5].
    - Can only install one of: symfony/console[v3.3.2, v5.0.5].
    - Can only install one of: symfony/console[v3.3.3, v5.0.5].
    - Can only install one of: symfony/console[v3.3.4, v5.0.5].
    - Can only install one of: symfony/console[v3.3.5, v5.0.5].
    - Can only install one of: symfony/console[v3.3.6, v5.0.5].
    - Can only install one of: symfony/console[v3.3.7, v5.0.5].
    - Can only install one of: symfony/console[v3.3.8, v5.0.5].
    - Can only install one of: symfony/console[v3.3.9, v5.0.5].
    - Can only install one of: symfony/console[v3.4.0, v5.0.5].
    - Can only install one of: symfony/console[v3.4.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v3.4.0-BETA2, v5.0.5].
    - Can only install one of: symfony/console[v3.4.0-BETA3, v5.0.5].
    - Can only install one of: symfony/console[v3.4.0-BETA4, v5.0.5].
    - Can only install one of: symfony/console[v3.4.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v3.4.0-RC2, v5.0.5].
    - Can only install one of: symfony/console[v3.4.1, v5.0.5].
    - Can only install one of: symfony/console[v3.4.10, v5.0.5].
    - Can only install one of: symfony/console[v3.4.11, v5.0.5].
    - Can only install one of: symfony/console[v3.4.12, v5.0.5].
    - Can only install one of: symfony/console[v3.4.13, v5.0.5].
    - Can only install one of: symfony/console[v3.4.14, v5.0.5].
    - Can only install one of: symfony/console[v3.4.15, v5.0.5].
    - Can only install one of: symfony/console[v3.4.16, v5.0.5].
    - Can only install one of: symfony/console[v3.4.17, v5.0.5].
    - Can only install one of: symfony/console[v3.4.18, v5.0.5].
    - Can only install one of: symfony/console[v3.4.19, v5.0.5].
    - Can only install one of: symfony/console[v3.4.2, v5.0.5].
    - Can only install one of: symfony/console[v3.4.20, v5.0.5].
    - Can only install one of: symfony/console[v3.4.21, v5.0.5].
    - Can only install one of: symfony/console[v3.4.22, v5.0.5].
    - Can only install one of: symfony/console[v3.4.23, v5.0.5].
    - Can only install one of: symfony/console[v3.4.24, v5.0.5].
    - Can only install one of: symfony/console[v3.4.25, v5.0.5].
    - Can only install one of: symfony/console[v3.4.26, v5.0.5].
    - Can only install one of: symfony/console[v3.4.27, v5.0.5].
    - Can only install one of: symfony/console[v3.4.28, v5.0.5].
    - Can only install one of: symfony/console[v3.4.29, v5.0.5].
    - Can only install one of: symfony/console[v3.4.3, v5.0.5].
    - Can only install one of: symfony/console[v3.4.30, v5.0.5].
    - Can only install one of: symfony/console[v3.4.31, v5.0.5].
    - Can only install one of: symfony/console[v3.4.32, v5.0.5].
    - Can only install one of: symfony/console[v3.4.33, v5.0.5].
    - Can only install one of: symfony/console[v3.4.34, v5.0.5].
    - Can only install one of: symfony/console[v3.4.35, v5.0.5].
    - Can only install one of: symfony/console[v3.4.36, v5.0.5].
    - Can only install one of: symfony/console[v3.4.37, v5.0.5].
    - Can only install one of: symfony/console[v3.4.38, v5.0.5].
    - Can only install one of: symfony/console[v3.4.4, v5.0.5].
    - Can only install one of: symfony/console[v3.4.5, v5.0.5].
    - Can only install one of: symfony/console[v3.4.6, v5.0.5].
    - Can only install one of: symfony/console[v3.4.7, v5.0.5].
    - Can only install one of: symfony/console[v3.4.8, v5.0.5].
    - Can only install one of: symfony/console[v3.4.9, v5.0.5].
    - Can only install one of: symfony/console[v4.0.0, v5.0.5].
    - Can only install one of: symfony/console[v4.0.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v4.0.0-BETA2, v5.0.5].
    - Can only install one of: symfony/console[v4.0.0-BETA3, v5.0.5].
    - Can only install one of: symfony/console[v4.0.0-BETA4, v5.0.5].
    - Can only install one of: symfony/console[v4.0.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v4.0.0-RC2, v5.0.5].
    - Can only install one of: symfony/console[v4.0.1, v5.0.5].
    - Can only install one of: symfony/console[v4.0.10, v5.0.5].
    - Can only install one of: symfony/console[v4.0.11, v5.0.5].
    - Can only install one of: symfony/console[v4.0.12, v5.0.5].
    - Can only install one of: symfony/console[v4.0.13, v5.0.5].
    - Can only install one of: symfony/console[v4.0.14, v5.0.5].
    - Can only install one of: symfony/console[v4.0.15, v5.0.5].
    - Can only install one of: symfony/console[v4.0.2, v5.0.5].
    - Can only install one of: symfony/console[v4.0.3, v5.0.5].
    - Can only install one of: symfony/console[v4.0.4, v5.0.5].
    - Can only install one of: symfony/console[v4.0.5, v5.0.5].
    - Can only install one of: symfony/console[v4.0.6, v5.0.5].
    - Can only install one of: symfony/console[v4.0.7, v5.0.5].
    - Can only install one of: symfony/console[v4.0.8, v5.0.5].
    - Can only install one of: symfony/console[v4.0.9, v5.0.5].
    - Can only install one of: symfony/console[v4.1.0, v5.0.5].
    - Can only install one of: symfony/console[v4.1.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v4.1.0-BETA2, v5.0.5].
    - Can only install one of: symfony/console[v4.1.0-BETA3, v5.0.5].
    - Can only install one of: symfony/console[v4.1.1, v5.0.5].
    - Can only install one of: symfony/console[v4.1.10, v5.0.5].
    - Can only install one of: symfony/console[v4.1.11, v5.0.5].
    - Can only install one of: symfony/console[v4.1.12, v5.0.5].
    - Can only install one of: symfony/console[v4.1.2, v5.0.5].
    - Can only install one of: symfony/console[v4.1.3, v5.0.5].
    - Can only install one of: symfony/console[v4.1.4, v5.0.5].
    - Can only install one of: symfony/console[v4.1.5, v5.0.5].
    - Can only install one of: symfony/console[v4.1.6, v5.0.5].
    - Can only install one of: symfony/console[v4.1.7, v5.0.5].
    - Can only install one of: symfony/console[v4.1.8, v5.0.5].
    - Can only install one of: symfony/console[v4.1.9, v5.0.5].
    - Can only install one of: symfony/console[v4.2.0, v5.0.5].
    - Can only install one of: symfony/console[v4.2.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v4.2.0-BETA2, v5.0.5].
    - Can only install one of: symfony/console[v4.2.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v4.2.1, v5.0.5].
    - Can only install one of: symfony/console[v4.2.10, v5.0.5].
    - Can only install one of: symfony/console[v4.2.11, v5.0.5].
    - Can only install one of: symfony/console[v4.2.12, v5.0.5].
    - Can only install one of: symfony/console[v4.2.2, v5.0.5].
    - Can only install one of: symfony/console[v4.2.3, v5.0.5].
    - Can only install one of: symfony/console[v4.2.4, v5.0.5].
    - Can only install one of: symfony/console[v4.2.5, v5.0.5].
    - Can only install one of: symfony/console[v4.2.6, v5.0.5].
    - Can only install one of: symfony/console[v4.2.7, v5.0.5].
    - Can only install one of: symfony/console[v4.2.8, v5.0.5].
    - Can only install one of: symfony/console[v4.2.9, v5.0.5].
    - Can only install one of: symfony/console[v4.3.0, v5.0.5].
    - Can only install one of: symfony/console[v4.3.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v4.3.0-BETA2, v5.0.5].
    - Can only install one of: symfony/console[v4.3.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v4.3.1, v5.0.5].
    - Can only install one of: symfony/console[v4.3.10, v5.0.5].
    - Can only install one of: symfony/console[v4.3.11, v5.0.5].
    - Can only install one of: symfony/console[v4.3.2, v5.0.5].
    - Can only install one of: symfony/console[v4.3.3, v5.0.5].
    - Can only install one of: symfony/console[v4.3.4, v5.0.5].
    - Can only install one of: symfony/console[v4.3.5, v5.0.5].
    - Can only install one of: symfony/console[v4.3.6, v5.0.5].
    - Can only install one of: symfony/console[v4.3.7, v5.0.5].
    - Can only install one of: symfony/console[v4.3.8, v5.0.5].
    - Can only install one of: symfony/console[v4.3.9, v5.0.5].
    - Can only install one of: symfony/console[v4.4.0, v5.0.5].
    - Can only install one of: symfony/console[v4.4.0-BETA1, v5.0.5].
    - Can only install one of: symfony/console[v4.4.0-BETA2, v5.0.5].
    - Can only install one of: symfony/console[v4.4.0-RC1, v5.0.5].
    - Can only install one of: symfony/console[v4.4.1, v5.0.5].
    - Can only install one of: symfony/console[v4.4.2, v5.0.5].
    - Can only install one of: symfony/console[v4.4.3, v5.0.5].
    - Can only install one of: symfony/console[v4.4.4, v5.0.5].
    - Can only install one of: symfony/console[v4.4.5, v5.0.5].
    - Installation request for symfony/console (locked at v5.0.5) -> satisfiable by symfony/console[v5.0.5].

Can you solve this issue by adding ^5.0 for symfony/console at https://github.com/sebastianbergmann/phpcov/blob/6.0.1/composer.json#L31?

Problem with merge of coverage files

I have a problem with phpcov used to merge .cov files. I use:

phpcov merge --clover clover.xml dir/

And after some output in xml i get:

PHP Catchable fatal error: Argument 1 passed to PHP_CodeCoverage::merge() must be an instance of PHP_CodeCoverage, integer given, called in phar:///usr/local/bin/phpcov/src/MergeCommand.php on line 119 and defined in phar:///usr/local/bin/phpcov/phpunit/php-code-coverage/src/CodeCoverage.php on line 369
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/phpcov:0
PHP 2. Symfony\Component\Console\Application->run() /usr/local/bin/phpcov:539
PHP 3. SebastianBergmann\PHPCOV\Application->doRun() phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:121
PHP 4. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/phpcov/src/Application.php:98
PHP 5. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:191
PHP 6. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:892
PHP 7. SebastianBergmann\PHPCOV\MergeCommand->execute() phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Command/Command.php:241
PHP 8. PHP_CodeCoverage->merge() phar:///usr/local/bin/phpcov/src/MergeCommand.php:119

Add commande line option to define low and high bound

The phpcov command line should implement options to define the lowUpperBound and highLowerBound boundaries. This settings are not accessible by the command line (only the PHPUnit interface can modify them).
I propose to add command line options "--lowupperbound" and "--highlowerbound" . Theses options are used by the HTML report to classify the coverage, but the default values (50% and 90%) cant be changed by the command line interface.
Thanks.

XML report generation broken by php-code-coverage starting in 5.1.0

Fatal error: Uncaught ArgumentCountError: Too few arguments to function SebastianBergmann\CodeCoverage\Report\Xml\Facade::__construct(), 0 passed in /var/www/vendor/phpunit/phpcov/src/BaseCommand.php on line 156 and exactly 1 expected in /var/www/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php on line 41

ArgumentCountError: Too few arguments to function SebastianBergmann\CodeCoverage\Report\Xml\Facade::__construct(), 0 passed in /var/www/vendor/phpunit/phpcov/src/BaseCommand.php on line 156 and exactly 1 expected in /var/www/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php on line 41

Call Stack:
    0.4015     377248   1. {main}() /var/www/vendor/phpunit/phpcov/phpcov:0
    0.4148    1963824   2. SebastianBergmann\PHPCOV\Application->run() /var/www/vendor/phpunit/phpcov/phpcov:31

Incorrect line percentage

phpcov gives a 100% coverage for a method but not all are been tested. As it can be seen on the following screenshot, there are lines marked in red but the summary gives 100% covered.

Sorry for the big screenshot, but it is the best way to understand the issue.
image

XML reports with zero-fill coverage

Hi,
I use the phpcov to get a xml report, and I got a zero-fill coverage as below,

image

My version:

php --version

PHP 7.1.6 (cli) (built: May 16 2018 15:17:43) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.7.0alpha2-dev, Copyright (c) 2002-2018, by Derick Rethans

phpunit --version

PHPUnit 4.8.9 by Sebastian Bergmann and contributors.

phpcov --version

phpcov 2.0.0 by Sebastian Bergmann.

MyTestData.txt

Cobertura can't parse xml report generated by phpcov

When integrating xml reports into cobertura got the following error:
"""
ERROR: Build step failed with exception
java.lang.NullPointerException
at hudson.plugins.cobertura.CoberturaXmlHandler.startElement(CoberturaCoverageParser.java:171)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
....
"""

I found that phpcov generate xml report with attribute "file name" while cobertura parse xml use "filename" and some other differences.

My version:phpcov 4.0.5;PHPUnit 6.5.0;cobertura 1.13
I want to know if it is caused by a version mismatch and How can I get a matching version?
Thank you.

jenkins cobertura

cobertura

coverage.xml

Failing merging html reports

phpcov: ^5.0

Output from Jenkins console:

+ ./vendor/bin/phpcov merge --html ./tests/coverage.html ./tests/cover
phpcov 5.0.0 by Sebastian Bergmann.


Generating code coverage report in HTML format ...
In Facade.php line 152:
                                                      
  Directory "./tests/coverage.html/" does not exist.  
                                                      

merge [--clover CLOVER] [--crap4j CRAP4J] [--html HTML] [--php PHP] [--text] [--xml XML] [--] <directory>

Add support for crap4j

PHPUnit has support for crap4j, it would be nice to also add it here as an option so that it could also generate it out after merging items together.

InvalidArgumentException occurs during html report generation

I tried to merge multiple cov files (exported via phpunit --coverage-php) into single html report.

 phpcov merge -v --html=reports-html/ reports/

reports-html is a target for the report
reports is a source with *.cov files

Output:

 phpcov merge -v --html=reports-html/ reports/
phpcov 2.0.0 by Sebastian Bergmann.


Generating code coverage report in HTML format ...


  [InvalidArgumentException]
  Template file could not be loaded.



Exception trace:
 () at phar:///local/USR/bin/phpcov/phpunit/php-text-template/Text/Template.php:112
 Text_Template->setFile() at phar:///local/USR/bin/phpcov/phpunit/php-text-template/Text/Template.php:88
 Text_Template->__construct() at phar:///local/USR/bin/phpcov/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Directory.php:65
 PHP_CodeCoverage_Report_HTML_Renderer_Directory->render() at phar:///local/USR/bin/phpcov/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php:143
 PHP_CodeCoverage_Report_HTML->process() at phar:///local/USR/bin/phpcov/src/BaseCommand.php:204
 SebastianBergmann\PHPCOV\BaseCommand->handleReports() at phar:///local/USR/bin/phpcov/src/MergeCommand.php:123
 SebastianBergmann\PHPCOV\MergeCommand->execute() at phar:///local/USR/bin/phpcov/symfony/console/Symfony/Component/Console/Command/Command.php:241
 Symfony\Component\Console\Command\Command->run() at phar:///local/USR/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:892
 Symfony\Component\Console\Application->doRunCommand() at phar:///local/USR/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:191
 Symfony\Component\Console\Application->doRun() at phar:///local/USR/bin/phpcov/src/Application.php:98
 SebastianBergmann\PHPCOV\Application->doRun() at phar:///local/USR/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:121
 Symfony\Component\Console\Application->run() at /local/USR/bin/phpcov:539


merge [--clover="..."] [--html="..."] [--php="..."] [--text="..."] directory


Segmentation fault

It also can show "zend_mm_heap corrupted", as I understand it depends from metrics and content of *.cov files.

phpunit version:

 phpunit -v
PHPUnit 4.1.0 by Sebastian Bergmann.

I also tried to adjust memory limit (up to 1Gb) - no sense.

The issue can be caused by the content of *.cov files. There are errors/incomplete and risky tests during processing.

PHP_CodeCoverage_Exception from running phpcov

When I run phpcov on a file that was generated by php-code-coverage(latest version, 2.0.15, following the "Using" section in its README to generate the file with PHP_CodeCoverage_Report_PHP), I get an exception.

tmp $ head code-coverage-report 
<?php
$coverage = new PHP_CodeCoverage;
$coverage->setData(array (
  '/p4-wdpro/Projects/NGE/Sites/pep/main/target/packaged-application/library/Zend/Controller/Plugin/Abstract.php' => 
  array (
    50 => 
    array (
    ),
    51 => 
    array (
tmp $ phpcov -vvv --html=foo.html execute code-coverage-report 
phpcov 2.0.1 by Sebastian Bergmann.




  [PHP_CodeCoverage_Exception]  



Exception trace:
 () at phar:///usr/local/bin/phpcov/phpunit/php-code-coverage/src/CodeCoverage.php:319
 PHP_CodeCoverage->append() at phar:///usr/local/bin/phpcov/phpunit/php-code-coverage/src/CodeCoverage.php:295
 PHP_CodeCoverage->stop() at phar:///usr/local/bin/phpcov/src/ExecuteCommand.php:154
 SebastianBergmann\PHPCOV\ExecuteCommand->execute() at phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Command/Command.php:252
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:887
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/phpcov/src/Application.php:98
 SebastianBergmann\PHPCOV\Application->doRun() at phar:///usr/local/bin/phpcov/symfony/console/Symfony/Component/Console/Application.php:124
 Symfony\Component\Console\Application->run() at /usr/local/bin/phpcov:552


execute [--configuration="..."] [--blacklist="..."] [--whitelist="..."] [--add-uncovered] [--process-uncovered] [--clover="..."] [--crap4j="..."] [--html="..."] [--php="..."] [--text="..."] script

I get the same results if I omit "--html=foo.html".

Merging .cov files ignores their filter settings

Each .cov file has its own filters - whitelists, blacklists, etc. When performing a phpcov merge operation, these filters are ignored, and a default filter is used.

In particular, this results in any processUncoveredFilesFromWhitelist setting being ignored. The filenames are all in the .cov's filter whitelist, but the merge operation ignores them.

Possibly there could be filter options made available to the command line, which would allow filtering the complete set, or perhaps the filter within the file being merged could be used to check against, instead of the default (see PHP_CodeCoverage::merge line which reads:

 if (!$this->filter->isFiltered($file)) {

--could potentially check $that->filter()->isFiltered($file) in this instance instead?)

Or some kind of pre-merge on the filters could happen.

I wouldn't be adverse to implementing something if a preferred design was decided upon.

Merge command returning null instead of int

Hello, I'm trying to run merge and it looks like it is working, all the files are generated.
But the return value of the execute method is null, causing the command to fail.

phpcov merge build/logs --clover build/logs/clover.xml

Error:

PHP Fatal error:  Uncaught TypeError: Return value of "SebastianBergmann\PHPCOV\MergeCommand::execute()" must be of the type int, NULL returned. in phar:///usr/local/bin/phpcov/symfony/console/Command/Command.php:258
Stack trace:
#0 phar:///usr/local/bin/phpcov/symfony/console/Application.php(925): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 phar:///usr/local/bin/phpcov/symfony/console/Application.php(265): Symfony\Component\Console\Application->doRunCommand(Object(SebastianBergmann\PHPCOV\MergeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///usr/local/bin/phpcov/src/Application.php(56): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/phpcov/symfony/console/Application.php(141): SebastianBergmann\PHPCOV\Applicat in phar:///usr/local/bin/phpcov/symfony/console/Command/Command.php on line 258

Fatal error: Uncaught TypeError: Return value of "SebastianBergmann\PHPCOV\MergeCommand::execute()" must be of the type int, NULL returned. in phar:///usr/local/bin/phpcov/symfony/console/Command/Command.php:258
Stack trace:
#0 phar:///usr/local/bin/phpcov/symfony/console/Application.php(925): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 phar:///usr/local/bin/phpcov/symfony/console/Application.php(265): Symfony\Component\Console\Application->doRunCommand(Object(SebastianBergmann\PHPCOV\MergeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///usr/local/bin/phpcov/src/Application.php(56): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/phpcov/symfony/console/Application.php(141): SebastianBergmann\PHPCOV\Applicat in phar:///usr/local/bin/phpcov/symfony/console/Command/Command.php on line 258

phpcov.phar: Template file could not be loaded.

Hello,

Using the phpcov.phar downloaded from https://phar.phpunit.de/phpcov.phar, I got the following issue:

$ ./bin/phpcov.phar -vvv merge --html ./coverage/ -- ./.temp/coverage/
phpcov 4.0.0 by Sebastian Bergmann.

Generating code coverage report in HTML format ...

[InvalidArgumentException]
Template file could not be loaded.

Exception trace:
() at phar:///XXX/phpunit/bin/phpcov.phar/phpunit/php-text-template/src/Template.php:70
Text_Template->setFile() at phar:///XXX/phpunit/bin/phpcov.phar/phpunit/php-text-template/src/Template.php:46
Text_Template->__construct() at phar:///XXX/phpunit/bin/phpcov.phar/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php:27
SebastianBergmann\CodeCoverage\Report\Html\Directory->render() at phar:///XXX/phpunit/bin/phpcov.phar/phpunit/php-code-coverage/src/Report/Html/Facade.php:97
SebastianBergmann\CodeCoverage\Report\Html\Facade->process() at phar:///XXX/phpunit/bin/phpcov.phar/src/BaseCommand.php:124
SebastianBergmann\PHPCOV\BaseCommand->handleReports() at phar:///XXX/phpunit/bin/phpcov.phar/src/MergeCommand.php:107
SebastianBergmann\PHPCOV\MergeCommand->execute() at phar:///XXX/phpunit/bin/phpcov.phar/symfony/console/Command/Command.php:262
Symfony\Component\Console\Command\Command->run() at phar:///XXX/phpunit/bin/phpcov.phar/symfony/console/Application.php:826
Symfony\Component\Console\Application->doRunCommand() at phar:///XXX/phpunit/bin/phpcov.phar/symfony/console/Application.php:189
Symfony\Component\Console\Application->doRun() at phar:///XXX/phpunit/bin/phpcov.phar/src/Application.php:57
SebastianBergmann\PHPCOV\Application->doRun() at phar:///XXX/phpunit/bin/phpcov.phar/symfony/console/Application.php:120
Symfony\Component\Console\Application->run() at /XXX/phpunit/bin/phpcov.phar:618

I've unsuccessfully tried running with absolute paths, and the following alternative syntaxes:

$ ./bin/phpcov.phar -vvv merge --html=./coverage/ -- ./.temp/coverage/
$ ./bin/phpcov.phar -vvv merge --html=./coverage/ ./.temp/coverage/

Environment:
$ php -v
PHP 7.1.3 (cli) (built: Apr 11 2017 13:08:01) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.1, Copyright (c) 2002-2017, by Derick Rethans
with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.