Skip to content

andreadelfino/phpunit-timings-printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPUnit ResultPrinter with Tests Timings

This printer just collect tests execution timings and report the slowest 10 exceeding a defined threshold in normal mode and all the timings in verbose mode.

Requirements

  • PHP 5.3.3 or later
  • PHPUnit 3.7 or later

Installation

To install it via composer composer just add in composer.json:

{
    "require-dev": {
        "andreadelfino/phpunit-timings-printer": "~0.1"
    }
}

Once installed, add the following attributes to the <phpunit> element in your phpunit.xml file:

    printerFile="vendor/andreadelfino/phpunit-timings-printer/lib/Timings/ResultPrinter.php"
    printerClass="Dolphin\PHPUnit\Timings\ResultPrinter"

and the following tag to tune Threshold and Verbose options:

    <listeners>
        <listener file="vendor/andreadelfino/phpunit-timings-printer/lib/Timings/TestListener.php"
            class="Dolphin\PHPUnit\Timings\TestListener">
            <arguments>
                <double>1.0</double>/* Threshold (default: 1.0) */
                <boolean>false</boolean>/* Verbose (default: false) */
            </arguments>
        </listener>
    </listeners>

Tests

To run the test suite you need composer.

$ php composer.phar install
$ vendor/bin/phpunit

License

Licensed under the MIT license.

About

PHPUnit ResultPrinter with Tests Timings

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages