Is there a way to disable code coverage in PHPUnit for a single test?(有没有办法为单个测试禁用 PHPUnit 中的代码覆盖率?)
问题描述
每次我在 PHPUnit 中运行一个单元测试时,也会生成一个代码覆盖率报告.我有一台旧电脑在工作,如果我可以在不需要它时禁用代码覆盖,那对我的 CPU 的压力就会更小.
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.
推荐答案
如何制作一个 phpunit.xml 的副本,从中删除 <logging>
节,然后执行以下操作:
How about making a copy of your phpunit.xml, removing the <logging>
stanza from it, then doing:
phpunit --configuration new.xml
这篇关于有没有办法为单个测试禁用 PHPUnit 中的代码覆盖率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有没有办法为单个测试禁用 PHPUnit 中的代码覆盖率?


基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何替换eregi() 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01