PHP code example of sergekukharev / phpunit-fasttrap
1. Go to this page and download the library: Download sergekukharev/phpunit-fasttrap 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/ */
sergekukharev / phpunit-fasttrap example snippets
class SomeTestCase extends \PHPUnit_Framework_TestCase
{
/**
* @fastThreshold 5000
*/
public function testLongRunningProcess()
{
// Code to exercise your long-running SUT
}
}
xml
<phpunit bootstrap="vendor/autoload.php">
...
<listeners>
<listener class="SergeKukharev\PHPUnit\Listener\FastTrapListener" />
</listeners>
</phpunit>
xml
<phpunit bootstrap="vendor/autoload.php">
<!-- ... other suite configuration here ... -->
<listeners>
<listener class="SergeKukharev\PHPUnit\Listener\FastTrapListener">
<arguments>
<array>
<element key="fastThreshold">
<integer>500</integer>
</element>
<element key="reportLength">
<integer>100</integer>
</element>
</array>
</arguments>
</listener>
</listeners>
</phpunit>