1happyplace/phpunit-colors

一个类,通过ANSI转义编码为PHPUnit测试输出添加颜色

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

This package is auto-updated.

Last update: 2024-08-29 03:42:10 UTC


README

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

Display类输出彩色输出,几乎适用于任何终端。它使用回DEC VT-100时代的转义编码。它可以在任何地方使用,但主要是针对PHPUnit测试用例中的消息。

这是一个没有依赖的独立静态类。

以下代码将创建以下输出:

    // 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"));