PHPUnit --no-coverage function to overwrite configuration file

I use PHPUnit to test my projects using the phpunit.xml.dist configuration file.

The default configuration for all my projects is configured to generate html code coverage reports.

In any case, can I run the phpunit command at a given time without generating code coverage reports without having to modify the configuration file?

This will be something like the --no-coverage option.

+6
source share
2 answers

I could not find anything from the documentation to refer to any functionality that would provide the ability to switch.

You can point PHPunit to a second phpunit.xml that does not have code coverage

You can see that this question has been asked before.

Is there a way to disable code coverage in PHPUnit for a single test?

+4
source

As Gonçalo Queirós noted in this answer , the --no-coverage option has --no-coverage supported since version 4.8.

+2
source

Source: https://habr.com/ru/post/945444/


All Articles