Every time I run a single unit test in PHPUnit, a code coverage report is also generated. I have an older computer here at work, and if I could disable the code coverage when I don't need it, that would put less strain on my CPU.
Is there a way to disable the code coverage on a per-test basis? I couldn't find any command-line switch that would do it.
To disable code coverage highlightingIn the Code Coverage Suites dialog, choose No coverage.
In computer science, code coverage is a measure used to describe the degree to which the source code of a program is tested by a particular test suite. A program with high code coverage has been more thoroughly tested and has a lower chance of containing software bugs than a program with low code coverage.
Configure coveragePress Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Coverage. Define how the collected coverage data will be processed: Show options before applying coverage to the editor: show the Code Coverage dialog every time you run a new run configuration with code coverage.
Since this is one of google top results, I think it makes sense to point out that since version 4.8 PHPUnit now supports the --no-coverage
option to override you xml configuration.
https://github.com/sebastianbergmann/phpunit/blob/4.8.0/ChangeLog-4.8.md
How about making a copy of your phpunit.xml, removing the <logging>
stanza from it, then doing:
phpunit --configuration new.xml
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