mathisburger / phpunit-stopwatch
There is no license information available for the latest version (v1.0.0) of this package.
A php library for phpunit to test the performance of php applications
v1.0.0
2022-10-22 16:11 UTC
Requires
- php: ^7.4 || 8.0.*
- phpunit/phpunit: ^9.5.25
- symfony/stopwatch: ^v5.4.13
Requires (Dev)
- friendsofphp/php-cs-fixer: 3.4.*
This package is auto-updated.
Last update: 2024-10-22 20:32:39 UTC
README
phpunit-stopwatch
A php library that provides some traits and testcases for phpunit for performance and memory testsProject information
Phpunit stopwatch is a simple php library that uses phpunit and stopwatch to perform tests on the memory usage and execution time of some php functions. It provides a simple test case as well as a trait that can be implemented in custom test cases.
Installation
Just install it via composer:
composer require mathisburger/phpunit-stopwatch
Usage
class SomeTest extends \MathisBurger\PhpUnitStopwatch\StopwatchTestCase { public function testSomething(): void { $this->runPerformanceTest(function () { sleep(2); }); // Is successful $this->assertExecutionTimeBelow(3000); } }
License
This project is MIT licensed