PHPackages                             fokin/phpunit-failures-formatter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. fokin/phpunit-failures-formatter

ActiveLibrary[Testing &amp; Quality](/categories/testing)

fokin/phpunit-failures-formatter
================================

Helps to colorize and format failure messages

v1.2(3y ago)11.9k↓68.3%MITPHPPHP &gt;=8.0

Since Mar 10Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/vicF/phpunit-failures-formatter)[ Packagist](https://packagist.org/packages/fokin/phpunit-failures-formatter)[ RSS](/packages/fokin-phpunit-failures-formatter/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Test Failures Formatter
=======================

[](#test-failures-formatter)

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
------------

[](#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

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance54

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Total

3

Last Release

1148d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33e7991c628f929c30e8335941452274450d27eb8f08792fef03f8adc881b9fd?d=identicon)[vicf](/maintainers/vicf)

---

Top Contributors

[![vicF](https://avatars.githubusercontent.com/u/2124165?v=4)](https://github.com/vicF "vicF (16 commits)")

### Embed Badge

![Health badge](/badges/fokin-phpunit-failures-formatter/health.svg)

```
[![Health](https://phpackages.com/badges/fokin-phpunit-failures-formatter/health.svg)](https://phpackages.com/packages/fokin-phpunit-failures-formatter)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
