Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpunit Result Printer Laravel Package

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+).

View on GitHub
Deep Wiki
Context7

Getting Started

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.

Implementation Patterns

  • Daily TDD workflow: After setup, just run phpunit as usual. The printer enhances readability with immediate visual feedback (pass/fail markers, class names, summary timing), speeding up local feedback loops.
  • Laravel-specific tweaks: Use 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.
  • CI-safe output: In GitHub Actions, Travis CI, etc., set cd-printer-anybar-enabled: false and optionally cd-printer-simple-output: true (to keep only default markers) to avoid ANSI artifacts or AnyBar warnings.
  • Custom branding: Update 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\....

Gotchas and Tips

  • Upgrade trap: After upgrading to ≥0.29.x, manually verify cd-printer-dont-format-classname: false exists in phpunit-printer.yml — otherwise class names may truncate and split oddly (e.g., UserTestTest).
  • AnyBar quirks: Even with 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.
  • Color handling: The printer respects global --colors=never, but cd-printer-simple-output: true overrides all custom markers — use only for raw output redirection (e.g., logging to file).
  • Config discovery: The printer searches for 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.
  • PHP/PHPUnit compatibility: Last release was June 2020. Works with PHP 7.1–8.0, but may break with PHPUnit 10+ due to deprecated internals. Check phpunit --version first. For PHPUnit 9.5+, use v0.27–0.30; avoid mixing with PHPUnit 10.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport