Skip to content

A simple wrapper to add some color and information to the phpunit/specify console output.

License

Notifications You must be signed in to change notification settings

barthy-koeln/beautify-specify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beautify-specify

A simple wrapper to add some color and information to the phpunit/specify terminal output.

Note: This is kiiind of hackaround. But it works.

Output

Image of BeautifySpecify Output

Installation

composer require --dev barthy-koeln/beautify-specify

Usage

Add the following to your phpunit.xml:

<phpunit
  printerClass="BarthyKoeln\BeautifySpecify\ResultPrinter"
/>

Please note that currently the only task of this result printer is not printing any progress or failures. The output is handled entirely in the Specify wrapper.

For each test case, replace any Specify trait with the trait provided by this library. Then, use the Specify framework as always and as described in the documentation.

Example:

use BarthyKoeln\BeautifySpecify\Specify;
use PHPUnit\Framework\TestCase;

class SomeClassTest extends TestCase
{
    use Specify;

    public function testValidation()
    {
        $this->describe(
            'SomeClass',
            function () {
                $this->it(
                    'has the correct default values',
                    function () {
                        $this->assertEquals([3.14159,  2.71828], $this->someClass->getValues());
                    }
                );

                // […]

            }
        );
    }
}

About

A simple wrapper to add some color and information to the phpunit/specify console output.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages