Questions tagged [pcov]

11 questions
4
votes
1 answer

PHPUnit Code coverage not including folders in report

I have a project where I ran phpunit with code coverage on the ./app folder. This worked fine and the phpunit.xml file had this section.
nicolaib
  • 627
  • 5
  • 26
4
votes
3 answers

Use other code coverage driver than xdebug

I want to use pcov instead of xdebug for code coverage generation. I'm using Docker and I have xdebug installed. Can I be sure that xdebug won't affect test execution if I run the following command? php -d xdebug.default_enable=0 -d pcov.enabled=1…
Tarasovych
  • 2,228
  • 3
  • 19
  • 51
2
votes
3 answers

PHPUnit gives No Code Coverage Driver Is Available

I have a laravel project and I tried to run phpunit to give me a coverage report. I ran the command vendor/bin/phpunit --coverage-html storage/test-output-data/coverage-html and it gave the output: PHPUnit 8.5.8 by Sebastian Bergmann and…
John
  • 32,403
  • 80
  • 251
  • 422
2
votes
0 answers

Replacement for xdebug_get_headers() function in PHP

I have a huge project and tests are taking very long. I want to speed up things by switching from XDebug to PCOV. I see a giant speed gain, but I have one problem. In a few places in my tests, I use xdebug_get_headers() to test headers (obviously).…
ren
  • 31
  • 4
1
vote
1 answer

php - PHPUnit with PCOV code coverage show 0% coverage on window

I use phpUnit with PCOV on code coverage on window. But somehow, I get 0.0% code coverage. I am sure the function is called. Why is this happening? Versions: PHP: 8.1.12 PHPUnit: 9.5.0 PCOV: 1.0.11 The running log is as follows PS C:\xampp\php>…
george
  • 11
  • 1
1
vote
0 answers

php unit test code coverage with drive Pcov problems about function_exists

enter image description here if (!function_exists('birthday_to_age')) { /** * calculate the age of input date * @param Carbon $date input date * @return int the age */ function birthday_to_age(Carbon $date): int { return floor((date('Ymd') -…
Tony Tao
  • 31
  • 1
1
vote
1 answer

Why is PHPUnit + pcov not generating code coverage stats?

I had PHPUnit configured to generate code coverage statistics using XDebug. Seeing that PCOV was faster, I disabled xdebug.so and installed pcov.so. Now, whenever I run my unit tests, the generated coverage report has no numbers or names or…
Quasipickle
  • 4,383
  • 1
  • 31
  • 53
1
vote
1 answer

How to have code coverage report with pcov?

I use PHP 8.0.5 , PHPUnit 9.5.4, PHPStorm 2021.1.2. When, in my XML configuration file, I use this : (This is only the relevant portion of…
lionelp
  • 443
  • 1
  • 7
  • 21
1
vote
0 answers

Strange behaviour on merging code-coverage of laravel-code tested by browser-kit-testing

Hi crowd intelligence! I have different testsuites that are processed parallel in teamcity with .cov-files as artifacts and one build-configuration that does a merge of the code-coverage. The strange thing is: code that is tested with the…
0
votes
0 answers

PHPUnit causes undefined method error when --coverage-text (using pcov)

I'm trying to get coverage with pcov & PHPUnit for my Laravel project on docker. I get an error PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Container\Container::basePath() when I add --coverage-text. No error occurs without…
Yusuke
  • 429
  • 4
  • 4
0
votes
0 answers

How to use PHPUnit code-coverage-tool PCOV in PhpStorm

I use PHP 7.4.13, PhpStorm 2020.1.4, PHPUnit 9.5.8. I try to use PHPUnit code coverage tool with PCOV, but I don't get it to work. I installed pcov: pecl install pcov I enabled the extension in the php.ini file: extension="pcov.so" My phpunit.xml…
Nele
  • 83
  • 1
  • 13