2017 © Pedro Peláez
 

library phpunit_stopwatch_annotations

phpunit test case with support for execution time and memory usage assertion in annotations

image

usernam3/phpunit_stopwatch_annotations

phpunit test case with support for execution time and memory usage assertion in annotations

  • Sunday, August 2, 2015
  • by usernam3
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 14 % Grown

The README.md

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., (*1)

Installation

Via Composer, (*2)

    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., (*3)

@executionTime value is measured in milliseconds @memoryUsage in bytes., (*4)

Example of test case:, (*5)

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

    /**
    * @test
    * @memoryUsage 2000000
    */
    public function memoryUsageFailed()
    {

    }
}

The Versions

02/08 2015

dev-master

9999999-dev

phpunit test case with support for execution time and memory usage assertion in annotations

  Sources   Download

MIT

The Requires

 

by Stanislav Dobrovolskiy

test phpunit annotation