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
- dev-master
- v1.0.3
- v1.0.2
- v1.0.1
- 1.0.0
- 0.32.0
- 0.31.0
- 0.30.1
- 0.30.0
- 0.29.3
- 0.29.2
- 0.29.1
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.2
- 0.26.1
- 0.26.0
- 0.25.1
- 0.25.0
- 0.24.1
- 0.23.4
- 0.23.3
- 0.23.2
- 0.23.0
- 0.22.0
- 0.21.1
- 0.21.0
- 0.20.3
- 0.20.2
- 0.20.1
- 0.20.0
- 0.19.14
- 0.19.13
- 0.19.12
- 0.19.10
- 0.19.9
- 0.19.8
- v0.19.6
- v0.19.5
- v0.19.4
- 0.19.3
- 0.19.2
- 0.19.1
- 0.19.0
- 0.18.10
- 0.18.9
- 0.18.7
- 0.18.6
- 0.18.5
- 0.18.4
- 0.18.3
- 0.18.0
- 0.17.1
- 0.16.1
- 0.16.0
- 0.15.5
- 0.15.4
- 0.15.3
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.2
- 0.12.1
- 0.12.0
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.0
- 0.10.1
- 0.10.0
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.1
- 0.6.0
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.0
- 0.3.0
- 0.2.1
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.2
- v0.0.1
- dev-patch-1
- dev-release-029
- dev-php74-phpunit9
- dev-143/phpunit8-undefined-method
- dev-137/cant-disable-colors-in-some-cases
- dev-125/pretty-print-assertions
- dev-bugfix/063-phpunit-71x-support
- dev-feature/055-support-customer-printer-markers
- dev-bugfix/023-remove-php7-type-hints
- dev-admin/018-add-circleci-support
This package is auto-updated.
Last update: 2026-09-13 05:51:24 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
