vedmant / phpunit-pretty-result-printer
PHPUnit Pretty Result Printer
Package info
github.com/vedmant/phpunit-pretty-result-printer
pkg:composer/vedmant/phpunit-pretty-result-printer
Requires
- php: ^8.2
- 2bj/phanybar: ^1.0
- phpunit/phpunit: ^11.0 || ^12.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0 || ^8.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
This package is auto-updated.
Last update: 2026-08-13 05:38:49 UTC
README
Version 1.0.0 — updated for PHPUnit 11 / 12 and PHP 8.2+ (including PHP 8.3 / 8.4 / 8.5).
📦 Packagist: vedmant/phpunit-pretty-result-printer
This is a maintained fork of codedungeon/phpunit-result-printer. The original package stopped at PHPUnit 9. PHPUnit 10 removed printerClass / --printer, so this rewrite is a PHPUnit extension that still prints the same compact progress line.
PHPUnit Pretty Result Printer 1.0.0 by Codedungeon and contributors.
==> Configuration: ~/project/phpunit-printer.yml
==> RefreshExternalDomainsCommandTest ✔ ✔ ✖ ⇢
==> SearchTest ✔ ✔
PHPUnit still prints its own failure details and summary. Only progress is replaced ($facade->replaceProgressOutput()), so you do not need --no-progress.
The class-name column uses about 60% of the actual terminal width (40–60 characters) so typical test names stay readable. Markers then fill the rest of the line, one space apart (✔ ✔). Very long names still get a leading ellipsis.
Installation
Install from Packagist:
composer require --dev vedmant/phpunit-pretty-result-printer
Requires PHP 8.2+ and PHPUnit 11 or 12.
If you previously used the abandoned codedungeon/phpunit-result-printer package, this fork replaces it so Composer can swap them cleanly.
Register the extension
Add the following to phpunit.xml (or phpunit.xml.dist):
<extensions> <bootstrap class="Codedungeon\PHPUnitPrettyResultPrinter\Extension"/> </extensions>
Optional initialization script
Copies default phpunit-printer.yml to the project root and writes the <extensions><bootstrap …> block into phpunit.xml (and removes a leftover printerClass attribute if present):
php vendor/vedmant/phpunit-pretty-result-printer/src/init.php
Do not use --printer=… or printerClass= — those options no longer exist in PHPUnit 10+.
AnyBar Integration
If you have AnyBar installed, enable it with cd-printer-anybar: true in phpunit-printer.yml. It is off by default (CI-friendly). AnyBar is only used on macOS.
Configuration Options
Create a phpunit-printer.yml file in your application root to override the package default (or anywhere up the parent tree. It will search recursively up the tree until a configuration file is found. If not found, the package default in src/phpunit-printer.yml is used).
Options
| Property Name | Default | Description |
|---|---|---|
cd-printer-hide-class |
false | Hides the display of the test class name |
cd-printer-simple-output |
false | Uses the default PHPUnit markers (but still uses this printer) |
cd-printer-show-config |
true | Show path to used configuration file |
cd-printer-hide-namespace |
true | Hide test class namespaces (will only show the class name) |
cd-printer-anybar |
false | Enable AnyBar (ignored if AnyBar is not installed / not macOS) |
cd-printer-anybar-port |
1738 | Define AnyBar port number |
cd-printer-dont-format-classname |
false | Show entire classname without padding / ellipsis |
- Class names are padded and, if needed, ellipsized to about 60% of the terminal width (40–60 characters) unless
cd-printer-dont-format-classnameistrue - If
cd-printer-dont-format-classnameistrue, nothing is formatted and the full classname is displayed
Markers
Customize markers by modifying phpunit-printer.yml.
| Marker | Value * |
|---|---|
| cd-pass | "✔ " |
| cd-fail | "✖ " |
| cd-error | "⚈ " |
| cd-skipped | "⇢ " |
| cd-incomplete | "∅ " |
| cd-risky | "⌽ " |
| cd-warning | "⚠ " |
| cd-deprecation | "▲ " |
| cd-notice | "ℹ " |
* Notice the single space after each marker. That is the gap between checks (✔ ✔); keep it when creating your own custom markers..
License
Copyright © 2017-2026 Mike Erickson and contributors
Released under the MIT license
Credits
Original package by Mike Erickson
E-Mail: codedungeon@gmail.com
Twitter: @codedungeon
Website: https://github.com/mikeerickson
Fork: https://github.com/vedmant/phpunit-pretty-result-printer
