承接 flying-anvil/punit-tools 相关项目开发

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

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

flying-anvil/punit-tools

最新稳定版本:0.1.4

Composer 安装命令:

composer require flying-anvil/punit-tools

包简介

Extensions for PHPUnit

README 文档

README

Extensions for PHPUnit

Installation

composer require --dev flying-anvil/punit-tools

Features

FeatureDescription
SlowTestReportKeeps track how long a test takes and gives a report of the slowest ones<br/>You can define thresholds for slow tests, either globally, for a whole test-class or a single test method

Slow Test

Configuration

<extensions>
  <extension class="\FlyingAnvil\PunitTools\SlowTestReport">
    <arguments>
      <!-- default threshold (in ms) -->
      <integer>100</integer>
      <!-- report length -->
      <integer>10</integer>
      <!-- report formatter (default | FQCN) -->
      <string>default</string>
      <array>
        <element key="useColors">
          <string>auto</string> <!-- always | never | auto -->
        </element>
      </array>
    </arguments>
  </extension>
</extensions>

Report Formatter

You can define a custom report formatter by specifying its FQCN. It must implement \FlyingAnvil\PunitTools\SlowTest\ReportFormatter\ReportFormatterInterface and must be instantiable via new without parameters.

Colors

When using auto, colors are used if running in an interactive session, and if piping the output or when running tests automated they are not used.

SlowThreshold Attribute

Use this attribute to overwrite the threshold for a single test or test class. Its value is the new threshold in ms.

#[SlowThreshold(1100)]
public function testThatIsExpectedToBeSlow(): void
{
    sleep(1);
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固