whatthejeff/nyancat-phpunit-resultprinter
A PHPUnit result printer that replaces the default output with an animated Nyan Cat, bringing a rainbow trail and a bit of fun to your test runs while still reporting results. Drop it in via PHPUnit config and enjoy the show.
This is a novelty result printer: it replaces PHPUnit's standard progress output with an animated Nyan Cat. It changes presentation only — pass/fail behavior, exit codes, and JUnit/coverage output are untouched. Treat it as a local developer-experience toy, not infrastructure.
Install (dev only):
composer require --dev whatthejeff/nyancat-phpunit-resultprinter
Where to look first:
composer.json of the package — check the phpunit/phpunit constraint. This package predates PHPUnit 10's removal of result printers, so compatibility is the first thing to verify.vendor/whatthejeff/nyancat-phpunit-resultprinter/src/ — confirm the exact FQCN you need to pass to --printer. It is typically:
WhatTheJeff\NyanCat\PHPUnit\ResultPrinter\NyanCatFirst use case — a single local run:
vendor/bin/phpunit --printer "WhatTheJeff\NyanCat\PHPUnit\ResultPrinter\NyanCat"
If that prints a cat instead of .S.F.., you're done. If it errors with "class not found" or a signature mismatch, stop here — the installed PHPUnit is outside the package's supported range.
1. One-off CLI flag (recommended default). Keep the default printer as the norm and opt into Nyan Cat explicitly. This avoids surprising teammates and CI logs.
vendor/bin/phpunit --printer "WhatTheJeff\NyanCat\PHPUnit\ResultPrinter\NyanCat" tests/Unit
2. Persistent via phpunit.xml (older PHPUnit only).
<phpunit printerClass="WhatTheJeff\NyanCat\PHPUnit\ResultPrinter\NyanCat">
Use this only in a dedicated local config (e.g. phpunit.nyan.xml) rather than the shared phpunit.xml, because printerClass is deprecated/removed in newer PHPUnit and will break the whole suite on upgrade.
3. Composer script for discoverability.
{
"scripts": {
"test": "phpunit",
"test:nyan": "phpunit --printer \"WhatTheJeff\\NyanCat\\PHPUnit\\ResultPrinter\\NyanCat\""
}
}
This gives the team a memorable entry point (composer test:nyan) without polluting the default composer test.
4. Environment split. Wire it into a Makefile/justfile target used for local feedback loops, while CI keeps the stock printer:
test: ; vendor/bin/phpunit
test-fun: ; vendor/bin/phpunit --printer "WhatTheJeff\NyanCat\PHPUnit\ResultPrinter\NyanCat"
5. Scoped runs.
Because it replaces progress output, it's most useful on a focused directory or a watch loop where you want a lightweight visual heartbeat. Pair it with --filter or a single test file rather than a 3,000-test suite.
6. Customization via subclassing.
The printer is a class like any other; if you want different colors or frame cadence, extend it and point --printer at your subclass. Inspect the parent for the frame/write methods before overriding — the internal API is not stable across PHPUnit versions, so pin your PHPUnit version if you go this route.
7. Pair with --colors=always when your terminal or wrapper doesn't auto-detect ANSI support, otherwise the cat may render as uncolored noise.
PHPUnit version compatibility is the big one. Result printers were deprecated and then removed in PHPUnit 10's event-based architecture. This package targets much older PHPUnit internals (PHPUnit_Util_Printer-era or early namespaced PHPUnit\TextUI\ResultPrinter). On modern PHPUnit you'll get a class-not-found, a fatal method-signature mismatch, or silently ignored config. Check composer show whatthejeff/nyancat-phpunit-resultprinter and the package's PHPUnit constraint before investing time.
Quote the FQCN in the shell. Backslashes are escape characters in bash/zsh; unquoted WhatTheJeff\NyanCat\... will mangle. In JSON scripts you need double-escaping (\\).
ANSI and TTY assumptions. The animation relies on carriage returns and terminal control sequences. When output is piped, redirected to a file, or captured by a CI runner, you'll get either a single frozen frame, no output, or raw escape codes in the log. It is not appropriate for CI artifacts, build logs, or anything you plan to grep.
IDE test runners often won't render it. PHPStorm/VS Code test integrations capture output through their own buffers and typically show a static frame or garbage. Use a real terminal for the effect.
Don't debug with it on. The Nyan Cat printer replaces the detailed failure output you rely on. When a test fails, re-run without --printer to get the standard diff/stack trace, or accept that you'll be squinting at a cat while the real error scrolls past.
Log volume and speed. On large suites, per-frame writes can noticeably slow the run and flood captured output. Prefer it on small, scoped runs.
Dev-only dependency hygiene. It's require-dev, so --no-dev installs are unaffected. But if you add printerClass to a shared phpunit.xml, production/CI installs without dev dependencies will fail to resolve the class. Keep the config isolated.
Windows terminals may need ANSI/VT processing enabled (Windows 10+ usually handles it; older cmd.exe does not). If the output looks broken, that's the cause, not the package.
Purely cosmetic — set expectations. At 281 stars and an "opportunity" score this low, this is a fun artifact, not actively maintained tooling. Adopt it as an opt-in easter egg for local runs, never as a required part of your test pipeline, and be prepared to drop it on your next PHPUnit major upgrade. If you want sustained visual test feedback, a modern alternative is a maintained progress/testdox reporter or a watch-mode tool that doesn't depend on PHPUnit's removed printer API.
How can I help you explore Laravel packages today?