定制 solital/phpunit-bridge 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

solital/phpunit-bridge

最新稳定版本:0.2.0

Composer 安装命令:

composer require --dev solital/phpunit-bridge

包简介

PHPUnit bridge for Solital Framework

README 文档

README

This package was created using the robiningelbrecht/phpunit-pretty-print component.

Installation

composer require solital/phpunit-bridge --dev

Configuration

Navigate to your phpunit.xml file and add following config to set default options (you can also set these options at run time):

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
    </bootstrap>
</extensions>

Also make sure the color attribute is set to true:

<phpunit 
        colors="true">
</phpunit>

Options

All these options can be set at runtime as well, see usage.

Output profiling report

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="displayProfiling" value="true"/>
    </bootstrap>
</extensions>

Enable compact mode

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="useCompactMode" value="true"/>
    </bootstrap>
</extensions>

Feel good about yourself after running your testsuite by displaying a Chuck Noris quote

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="displayQuote" value="true"/>
    </bootstrap>
</extensions>

Disable pretty print.

This can be useful when you only want to prettify the output when forced via CLI (see usage).

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="enableByDefault" value="false"/>
    </bootstrap>
</extensions>

Usage

> vendor/bin/phpunit

Output profiling report

> vendor/bin/phpunit -d --profiling

Enable compact mode

> vendor/bin/phpunit -d --compact

Display Chuck Norris quote

> vendor/bin/phpunit -d --display-quote

Enable/disable pretty print

> vendor/bin/phpunit -d --enable-pretty-print
> vendor/bin/phpunit -d --disable-pretty-print

Combine multiple options

> vendor/bin/phpunit --configuration=tests/phpunit.test.xml -d --compact -d --display-quote

PHPUnit 9.x

This package does not support PHPUnit 9.x

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-09-05