Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

PHPUnit stopwatch annotations

PHPUnit stopwatch annotations is a PHPUnit test case with support for execution time and memory usage assertion in annotations. It uses symfony/Stopwatch component for tracking time and memory usage of tests.

Installation

Via Composer

	composer require --dev "usernam3/phpunit_stopwatch_annotations:dev-master"

Usage

To add support of @executionTime and @memoryUsage annotations you need to extend your test case class from \StopwatchAnnotations\TestCase.

@executionTime value is measured in milliseconds @memoryUsage in bytes.

Example of test case:

class ExampleTest extends \StopwatchAnnotations\TestCase {
    /**
     * @test
     * @executionTime 1999
     */
    public function executionTimeFailed()
    {
        sleep(2);
    }
    
    /**
    * @test
    * @memoryUsage 2000000
    */
    public function memoryUsageFailed()
    {
    
    }
}

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages