I like many developers love test driven development so in this short tutorial, I'll show you how to use an awesome package to spice up your
PHPUnit test results by adding Nyancats to the printer results.


Please make sure that you have the following:

  • PHPUnit
  • Composer
  • PHP 5.3.3 or later.
  • A terminal emulator with support for ANSI escape sequences, including color and cursor control.


Add the following to your composer file:

    "require-dev": {
        "whatthejeff/nyancat-phpunit-resultprinter": "~1.2"

You will then have to run composer update to install the new dependencies that you added to your composer.json file.

Screen Shot 2017 10 05 at 10 10 03 AM

Once installed, open your phpunit.xml and add the following attributes to the <phpunit> element.


Running Tests

Once installed, you can simply run your PHPUnit tests as per normal:


If everything worked as intended, you should now see an awesome Nyancat with your test results!

Screen Shot 2017 10 05 at 10 10 50 AM

Let me know if you have any questions or feedback in the comments below.