stolt/phpunit-blink1-test-listener

A blink(1) test listener for PHPUnit.

v2.0.0 2018-04-06 14:41 UTC

README

Build Status Version PHP Version

This package provides an implementation of the PHPUnit_Framework_TestListener interface interacting with a blink(1) USB notification LED light. It provides you a fast, visual feedback loop while TDDing with PHPUnit.

With this test listener a failing PHPUnit test run will turn the LED light red, while a successful one will make it blink green, and while incomplete, skipped, or risky tests will make it blink yellow.

Preconditions

This package assumes that the blink1-tool is installed on your system to enable the communication with your blink(1) LED light. On Mac OS, the targeted system of this package, this can be done easily via brew.

$ brew install blink1

Installation via Composer

$ composer require --dev stolt/phpunit-blink1-test-listener

Configuration

To use the blink(1) test listener with its default configuration add the following to your phpunit.xml(.dist) file.

<extensions>
  <extension class="Stolt\PHPUnit\Extension\Blink1" />
</extensions>

It's possible to configure the blink amount (default is three) of the test state colors. Furthermore it's also possible to overwrite the behavior of the failure test state (default is a permanently turned on LED until a test state transition happens) to uniflow with the other test states.

<extensions>
  <extension class="Stolt\PHPUnit\Extension\Blink1">
    <arguments>
        <integer>2</integer><!-- Blink two times. -->
        <boolean>false</boolean><!-- Blink on failure. -->
    </arguments>
  </extension>
</extensions>

Running tests

$ composer test

License

This package is licensed under the MIT license. Please see LICENSE for more details.

Changelog

Please see CHANGELOG for more details.

Code of Conduct

Please see CONDUCT for more details.

Contributing

Please see CONTRIBUTING for more details.