Code Monkey home page Code Monkey logo

nyancat-phpunit-resultprinter's Introduction

Video of the Nyan Cat result printer for PHPUnit

Requirements

The Nyan Cat result printer for PHPUnit requires:

  • PHP 7+.
  • PHPUnit 6+.
  • A terminal emulator with support for ANSI escape sequences, including color and cursor control.

Use version ^1.3 to support PHPUnit 4.8+ / 5+.

NOTE: By default, the Windows console does not support ANSI escape sequences. If you'd like to use the Nyan Cat result printer on Windows, you may want to try one of the following solutions:

Installation

The recommended way to install the Nyan Cat result printer for PHPUnit is through composer. Just create a composer.json file and run the composer install command to install it:

{
    "require-dev": {
        "whatthejeff/nyancat-phpunit-resultprinter": "^2.0"
    }
}

Once installed, add the following attributes to the <phpunit> element in your phpunit.xml file:

printerFile="vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php"
printerClass="NyanCat\PHPUnit\ResultPrinter"

NOTE: If PHPUnit was not installed via composer, you also need to include the composer autoloader. One easy way to do this is to add the following attribute to the <phpunit> element in your phpunit.xml file:

bootstrap="vendor/autoload.php"

Tests

Build Status

To run the test suite, you need composer.

$ composer install
$ composer test

Acknowledgements

The Nyan Cat result printer for PHPUnit was heavily inspired by the glorious mocha/nyan.js.

License

The Nyan Cat result printer for PHPUnit is licensed under the MIT license.

nyancat-phpunit-resultprinter's People

Contributors

gilo-agilo avatar jeroendedauw avatar johnkary avatar whatthejeff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nyancat-phpunit-resultprinter's Issues

ResultPrinter class not compatible with phpUnit version 7

Composer installs phpUnit version 7.5 by default now. Method declarations on overridden methods no longer match and throw fatal errors. I have submitted a pull request that will fix the issue.

Make result printer compatible with phpUnit version 7 #18

this printer breaks --debug

While I'd love to use this in our project setup, sadly phpunit --debug doesn't work anymore, so I think there has to be a way to enable --debug again without having to change phpunit.xml.

Disabling nyancat when --debug is used might be a bit harsh, but could raise adoption.

PHP Fatal error: Declaration of NyanCat\PHPUnit\ResultPrinter::addError(PHPUnit\Framework\Test $test, Exception $e, $time) must be compatible with PHPUnit\TextUI\ResultPrinter::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void in /Users/renatog/Projects/JnJ/PGA/genius/drupal/vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php on line 181

Hello guys!

Congrats on your project.

I'm trying to use but I got this error:

Command
$ vendor/bin/phpunit --configuration web/profile web/profiles/contrib/profile/modules/phpunit/tests/src/Unit/ClassTest.php

Result:
PHP Fatal error: Declaration of NyanCat\PHPUnit\ResultPrinter::addError(PHPUnit\Framework\Test $test, Exception $e, $time) must be compatible with PHPUnit\TextUI\ResultPrinter::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void in /Users/renatog/Projects/JnJ/PGA/genius/drupal/vendor/whatthejeff/nyancat-phpunit resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php on line 181

Do you know how we can solve it?

Thanks

Error with PHPUnit 6.x

> vendor/bin/phpunit

Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in /home/j/workspace/software.wikimedia.de/vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php on line 31
PHP Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in /home/j/workspace/software.wikimedia.de/vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php on line 31

That is with PHPUnit ~6.0. ~5.7 works fine

Proposal: --testdox like, argument support

First than all, this is a great project. Thanks for your work.
I only have one wish. I can't run your reporter library with the --testdox arg
Actually I don't really know how any of this thinks works and if it's even possible for them to work together.

Doesn't work with system-installed PHPUnit (without extra config).

Following the instructions in the README don't actually work, since the Composer autoloader is never included.

PHP Fatal error:  Class 'NyanCat\Scoreboard' not found in …/vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php on line 45

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.