beautify specify
v1.0.2 | Bugfix
A simple wrapper to add some color and information to the phpunit/specify terminal output.
Note: This is kiiind of hackaround. But it works.
composer require --dev barthy-koeln/beautify-specify
Add the following to your phpunit.xml
:
<phpunit
printerClass="BarthyKoelnBeautifySpecifyResultPrinter"
/>
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.
use BarthyKoelnBeautifySpecifySpecify;
use PHPUnitFrameworkTestCase;
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());
}
);
// […]
}
);
}
}