solital/phpunit-bridge

There is no license information available for the latest version (0.1.1) of this package.

PHPUnit bridge for Solital Framework

0.1.1 2024-10-24 12:27 UTC

This package is auto-updated.

Last update: 2024-10-24 12:28:12 UTC


README

This package was created using the robiningelbrecht/phpunit-pretty-print component.

Installation

composer require solital/phpunit-bridge --dev

Configuration

Navigate to your phpunit.xml file and add following config to set default options (you can also set these options at run time):

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
    </bootstrap>
</extensions>

Also make sure the color attribute is set to true:

<phpunit 
        colors="true">
</phpunit>

Options

All these options can be set at runtime as well, see usage.

Output profiling report

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="displayProfiling" value="true"/>
    </bootstrap>
</extensions>

Enable compact mode

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="useCompactMode" value="true"/>
    </bootstrap>
</extensions>

Feel good about yourself after running your testsuite by displaying a Chuck Noris quote

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="displayQuote" value="true"/>
    </bootstrap>
</extensions>

Disable pretty print.

This can be useful when you only want to prettify the output when forced via CLI (see usage).

<extensions>
    <bootstrap class="Solital\PHPUnit\PhpUnitExtension">
        <parameter name="enableByDefault" value="false"/>
    </bootstrap>
</extensions>

Usage

> vendor/bin/phpunit

Output profiling report

> vendor/bin/phpunit -d --profiling

Enable compact mode

> vendor/bin/phpunit -d --compact

Display Chuck Norris quote

> vendor/bin/phpunit -d --display-quote

Enable/disable pretty print

> vendor/bin/phpunit -d --enable-pretty-print
> vendor/bin/phpunit -d --disable-pretty-print

Combine multiple options

> vendor/bin/phpunit --configuration=tests/phpunit.test.xml -d --compact -d --display-quote

PHPUnit 9.x

This package does not support PHPUnit 9.x

License

MIT