承接 gosuperscript/phpunit-coverage 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gosuperscript/phpunit-coverage

Composer 安装命令:

composer require gosuperscript/phpunit-coverage

包简介

PHPUnit extension that fails the test run when total code coverage drops below a configurable minimum.

README 文档

README

A PHPUnit extension that fails the test run when total line coverage drops below a configured minimum. Compatible with PHPUnit 11, 12 and 13.

Install

composer require --dev gosuperscript/phpunit-coverage

Configure

Add the extension to your phpunit.xml (or phpunit.xml.dist):

<phpunit>
    <extensions>
        <bootstrap class="Superscript\PhpunitCoverage\Extension">
            <parameter name="minimum" value="100"/>
        </bootstrap>
    </extensions>

    <source>
        <include>
            <directory>src</directory>
        </include>
    </source>
</phpunit>
Parameter Default Description
minimum 100 Minimum total line coverage percentage required to pass.

Behaviour

The extension only checks coverage when PHPUnit has actually collected it — that is, when you run PHPUnit with a coverage report flag (e.g. --coverage-text, --coverage-clover, --coverage-html) and a coverage driver (Xdebug or PCOV) is installed.

  • Coverage enabled, below minimum: the run fails with exit code 1 and a message printed to STDERR.
  • Coverage enabled, at or above minimum: the run continues normally.
  • Coverage disabled, running locally: a PHPUnit warning is emitted, the run continues. Lets you run vendor/bin/phpunit without coverage during development.
  • Coverage disabled, running on CI: the run fails with exit code 1. CI is detected via the CI environment variable (set by GitHub Actions, GitLab CI, CircleCI, Travis, Buildkite, and others).

Run

vendor/bin/phpunit --coverage-text

License

MIT

统计信息

  • 总下载量: 561
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固