1. Go to this page and download the library: Download johnkary/phpunit-speedtrap library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
johnkary / phpunit-speedtrap example snippets
class SomeTestCase extends PHPUnit\Framework\TestCase
{
/**
* @slowThreshold 5000
*/
public function testLongRunningProcess()
{
// Code that takes a longer time to execute
}
}
xml
<phpunit bootstrap="vendor/autoload.php">
...
<extensions>
<extension class="JohnKary\PHPUnit\Extension\SpeedTrap" />
</extensions>
</phpunit>
xml
<phpunit bootstrap="vendor/autoload.php">
<!-- ... other suite configuration here ... -->
<extensions>
<extension class="JohnKary\PHPUnit\Extension\SpeedTrap">
<arguments>
<array>
<element key="slowThreshold">
<integer>500</integer>
</element>
<element key="reportLength">
<integer>10</integer>
</element>
</array>
</arguments>
</extension>
</extensions>
</phpunit>