codedungeon/phpunit-result-printer
Modern, pretty result printer for PHPUnit. Easy install via Composer, optional init script updates phpunit.xml and adds a default phpunit-printer.yml. Supports CLI/manual configuration, upgrade notes, and optional AnyBar integration (off by default; PHPUnit 7.1+).
Install as a dev dependency:
composer require --dev codedungeon/phpunit-result-printer
Then run the initialization script to auto-configure phpunit.xml and generate phpunit-printer.yml:
php ./vendor/codedungeon/phpunit-result-printer/src/init.php
This adds printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer" to phpunit.xml and creates a customizable config file in your project root. Run phpunit — you’ll immediately see colored output with ✔/✖ icons instead of dots andFs.
phpunit as usual. The printer enhances readability with immediate visual feedback (pass/fail markers, class names, summary timing), speeding up local feedback loops.php artisan test with the printer — works out of the box. If using Laravel’s Collision (deprecated), avoid conflicts by not using the --collision flag with init.php or disable Collision entirely.cd-printer-anybar-enabled: false and optionally cd-printer-simple-output: true (to keep only default markers) to avoid ANSI artifacts or AnyBar warnings.phpunit-printer.yml to change markers (e.g., cd-pass: "✅ "), hide namespaces (cd-printer-hide-namespace: true), or suppress class formatting (cd-printer-dont-format-classname: true) for deep namespaces like App\Tests\Integration\v2\....cd-printer-dont-format-classname: false exists in phpunit-printer.yml — otherwise class names may truncate and split oddly (e.g., UserTest → Test).cd-printer-anybar-enabled: true, it only works on macOS and only if AnyBar is installed and running (check with brew services list). It fails silently on Windows/Linux or headless environments — disable it in CI configs.--colors=never, but cd-printer-simple-output: true overrides all custom markers — use only for raw output redirection (e.g., logging to file).phpunit-printer.yml up the directory tree, so cd-tests/ or subdirectories inherit root config. To isolate configs, place a new phpunit-printer.yml in the subdirectory.phpunit --version first. For PHPUnit 9.5+, use v0.27–0.30; avoid mixing with PHPUnit 10.How can I help you explore Laravel packages today?