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 Printer Laravel Package

tflori/phpunit-printer

Custom PHPUnit printers for cleaner test output. Includes TextPrinter for human-friendly, readable progress reporting. Install via Composer and enable via phpunit --printer or printerClass in phpunit.xml; works across multiple PHP/PHPUnit versions.

View on GitHub
Deep Wiki
Context7

Getting Started

Install via Composer: composer require --dev tflori/phpunit-printer. Configure PHPUnit to use one of its custom printers by adding a <printer> element in phpunit.xml—for example: <printer class="Tflori\PHPUnitPrinter\DebugPrinter" />. Start with the DebugPrinter to see detailed test execution flow, including method calls, assertions, and now assertion counts (new in v2.1.0). The ProgressPrinter also now conditionally renders colored status icons only when TTY output is detected, improving CI compatibility.

Implementation Patterns

Developers integrate this package to customize test output formatting—e.g., using CompactPrinter for CI environments where minimal noise is desired, or ProgressPrinter to show real-time progress with assertion counts (new in v2.1.0). Printers are stateful and implement PHPUnit\TextUI\ResultPrinter, so they can be extended or reused across projects. A common pattern is to swap printers dynamically via environment variables (e.g., PHPUnit_Printer=compact), allowing local development with verbose feedback while keeping CI output clean. The new assertion count feature is particularly useful for tracking test granularity without cluttering output.

Gotchas and Tips

  • Printer class names must be fully qualified and match PSR-4 autoloading; misconfigured phpunit.xml paths cause silent "class not found" errors.
  • The ProgressPrinter now conditionally renders colored status icons only when TTY output is detected (v2.1.0), reducing CI output issues, but verify behavior in non-TTY environments if customizing further.
  • The package’s minimal stars and 2022 release date suggest limited active maintenance; verify compatibility with your PHPUnit version (tested up to PHPUnit 9.x, may fail on 10+).
  • For custom logic, extend the base ResultPrinter class instead of relying solely on included printers—this ensures future-proofing if built-in printers are deprecated.
  • Assertion counts (new in v2.1.0) are additive and may impact performance in large test suites; test in your environment to confirm acceptable overhead.
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope