maurobaptista/phpunit-slow-tests
最新稳定版本:0.0.3
Composer 安装命令:
composer require maurobaptista/phpunit-slow-tests
包简介
Get a better overview of the slowests tests in your suite
README 文档
README
Installation
You can install the package via composer:
composer require maurobaptista/phpunit-slow-tests --dev
Usage
In your phpunit.xml file, add the extensions as below.
<extensions> <extension class="MauroBaptista\SlowTests\Extensions\ResultToCSV"> <arguments> <string>tests/report/result.csv</string> </arguments> </extension> <extension class="MauroBaptista\SlowTests\Extensions\SlowestTests" /> </extensions>
Configuration
ResultToCSV Extension
A CSV export of the time of all ran tests will be stored in this file.
<extensions> <extension class="MauroBaptista\SlowTests\Extensions\ResultToCSV"> <arguments> <string>tests/report/result.csv</string> </arguments> </extension> </extensions>
Arguments:
| Argument | Type | Default | Note |
|---|---|---|---|
| file | string | result.csv |
Path to the file (can be a relative path) |
Output:
Console:
File:
datetime,class,method,duration "2022-11-08 02:06:23","Tests\Unit\ExampleTest",that_true_is_true,0.0055065 "2022-11-08 02:06:23","Tests\Feature\ExampleTest",that_true_is_true,0.186276667
SlowestTests
<extensions> <extension class="MauroBaptista\SlowTests\Extensions\SlowestTests"> <arguments> <integer>10</integer> <array> <element key="success"> <double>0.1</double> </element> <element key="warning"> <double>1</double> </element> </array> </arguments> </extension> </extensions>
Arguments:
| Argument | Type | Default | Note |
|---|---|---|---|
| show | integer | 10 | Amount of tests that will be shown after the test ran |
| threshold | array | ['success' => 0.1, 'warning' => 1] |
Time to show tests as green, yellow, or red (in seconds) |
Output:
Console:
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 1.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-08