abwebdevelopers/phpunit-presenter
Composer 安装命令:
composer require abwebdevelopers/phpunit-presenter
包简介
A presentable result printer for PHPUnit
README 文档
README
Displays the PHPUnit test results in a more presentable and friendly format. The Presenter includes timings for tests, colour support and better displays of errors and failures.
This has only been tested with PHPUnit ^7.5. However, this plugin still allows PHPUnit up to ^9.0 (via composer.json) to ease dependency restrictions but please note that things may not work as expected (use at your own 'risk').
Features
- Different formatting types depending on your preferences.
- Grouping of test cases and suites.
- Time taken for each test case.
- Optional colour support.
How to use
Simply include this library via Composer:
composer require --dev abwebdevelopers/phpunit-presenter
And then add it to your phpunit.xml file as the printerClass attribute
<phpunit ... printerClass="ABWebDevelopers\PHPUnitPresenter\Presenter" ... >
Configuration
The Presenter can be configured via environment variables. The following environment variables are used:
| Environment Variable | Default | Description |
|---|---|---|
PRESENTER_SHOW_TIMES |
1 |
Displays the time taken for test cases. Set to 0 to disable. |
PRESENTER_COLOURS |
1 |
Displays colouring of CLI output. Set to 0 to disable. It is recommended to disable colours for test environments, ie. Travis CI. |
PRESENTER_HIDE_SUCCESSFUL |
0 |
If enabled, will hide all successful tests, and only show failed or errored tests. Set to 1 to enable. |
PRESENTER_FORMAT |
default |
Sets the format used to display results via Presenter. Valid values are default, feed and condensed. It is recommended to use feed or condensed for test environments, ie. Travis CI. |
Formats
There are three types of formatting of the results displayed by Presenter - default, feed and condensed.
default and feed display the same information (shown in the screenshot above), however, default uses CLI line overwriting to show real-time progress of tests. This may not work with some log readers used in test environments (such as Travis CI), so it is recommended to use feed for test environments.
A third format condensed presents test results in a condensed format closer to PHPUnit's default result printer. When using condensed, it is implied that PRESENTER_SHOW_TIMES is set to 0. The formatting of condensed looks similar to this:
License
MIT.
abwebdevelopers/phpunit-presenter 适用场景与选型建议
abwebdevelopers/phpunit-presenter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 860 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「phpunit」 「unit」 「tests」 「presentation」 「results」 「printer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 abwebdevelopers/phpunit-presenter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 abwebdevelopers/phpunit-presenter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 abwebdevelopers/phpunit-presenter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LazyPDO is a set of wrappers over PHP's standard PDO and PDOStatement classes. It enables lazy loading, serialization and decoration.
HiDev plugin for PHPUnit
Testing Suite For Lumen like Laravel does.
Symfony bundle for unigen test generator
A cli tool which generates unit tests.
Swoole server process management
统计信息
- 总下载量: 860
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-23