dev-master
9999999-devphpunit test case with support for execution time and memory usage assertion in annotations
MIT
The Requires
by Stanislav Dobrovolskiy
test phpunit annotation
Wallogit.com
2017 © Pedro Peláez
phpunit test case with support for execution time and memory usage assertion in 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)
Via Composer, (*2)
composer require --dev "usernam3/phpunit_stopwatch_annotations:dev-master"
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()
{
}
}
phpunit test case with support for execution time and memory usage assertion in annotations
MIT
test phpunit annotation