I use PHPUnit to test my projects, using a phpunit.xml.dist
config file.
The default configuration for all my projects is set to generate html code coverage reports.
Is there anyway I can run the phpunit
command at a given time without generating the code coverage reports without having to change the config file?
This would be something like a --no-coverage
option.
PHPUnit uses XML file for configuration. This configuration file can be added to your version control system so all developers get the same output. These settings will help you make sure your tests work the way you want.
The <testsuite> Element.
As noted by Gonçalo Queirós in this answer, the --no-coverage
option is supported since version 4.8.
I couldn't find anything from the documentation to reference any sort of functionality that would provide the option to be a toggle.
You could point PHPunit to a second phpunit.xml that doesn't have the code coverage
You can see this very question being asked prior.
Is there a way to disable code coverage in PHPUnit for a single test?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With