承接 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.58k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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