1happyplace/phpunit-colors

Class that adds color to PHPUnit testing output using ANSI escape coding

v1.2 2020-01-06 18:19 UTC

This package is auto-updated.

Last update: 2024-04-29 02:40:25 UTC


README

#PHPUnitColors\Display# clio.1happyplace.com/utilities/phpunit-color-display.html

The Display class outputs colored output that will work on virtually any terminal. It utilizes the escape coding that goes back to the days of the DEC VT-100. It can be used anywhere, but is geared toward messages during PHPUnit tests cases.

It is a standalone static class with no dependencies.

The following code will create the output below:

    // echo out the escaped strings to create different levels of warnings
    echo Display::warning("Warning!");
    echo Display::caution("Caution...");
    echo Display::OK("OK to go!");

    // place the escaped string in the $message field to light up your output
    $this->assertSame("one","two",Display::caution("This assertion has intentionally failed"));

687474703a2f2f636c696f2e316861707079706c6163652e636f6d2f5f696d616765732f504850556e6974436f6c6f72732d446973706c61792e706e67