定制 fokin/phpunit-failures-formatter 二次开发

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

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

fokin/phpunit-failures-formatter

最新稳定版本:v1.2

Composer 安装命令:

composer require fokin/phpunit-failures-formatter

包简介

Helps to colorize and format failure messages

README 文档

README

Can be used with phpunit or codeception to format failure messages for test assertions. It can create colored messages describing expected result in green, actual result (failure) in red. Additionally it will format various data you supply that may help you to identify the cause of failure. Incoming parameters and results in various PHP formats, URLs etc. Also it adds Jira tags so that failure can be copied from console to Jira issue.

Installation

composer require --dev fokin/phpunit-failures-formatter

##Usage

You can use formatter directly by creating new object new Formatter()

or add trait to your TestCase class: use Fokin\PhpunitFailuresFormatter\FormatterTrait;. In second case you will be able to call expected() method directly $this->expected(...)

You can also define your own method of calling formatter or override formatter class to add your own methods.

In your test case: $this->assertTrue(false, $this->expected('I thought that it would be true') ->actual('Sad to admit that it is false') ->reg(['This is example array'=> 'that would be printed'], 'Example of incoming data') ->res('Example result data') ->url('http://localhost/bad_page', 'URL that failed') ->jiraIssue('ABC-123', 'Last known issue for this case') );

To add Jira tags to the output define constant JIRA_TAGS

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固