- Changelog (
v3.3.0...v.4.0.0
) - PR #81 Reformat slow test case output for compatibility with PHPUnit --filter option
- PR #82 New option
stopOnSlow
stops execution upon first slow test. Default: false. - PR #84 New annotation option
@slowThreshold 0
disables checks for individual tests. - README documents incompatibility with Symfony Framework
simple-phpunit
This is the last release compatible with PHP < 7.2 and PHPUnit < 8.0. SpeedTrap v5.0.0 will be upgrading to the PHPUnit Extension system instead of the TestListener system.
Despite being a new feature in v4.0.0, the stopOnSlow
configuration will be removed in v5.0.0 because the new PHPUnit Extension system does not support Extensions stopping the test runner.
BC Break: Slowness report changes formatting of slow class names
You may encounter a backwards compatibility break if you programmatically parse the console output from SpeedTrap.
Prior to 4.0 the slowness report displayed the qualified class name in a human-readable format:
1. 800ms to run JohnKary\PHPUnit\Listener\Tests\SomeSlowTest:testWithDataProvider with data set "Rock"
Starting at 4.0 the slowness report displays class names in a format ready to be used with PHPUnit's --filter option by adding slashes to the namespace delimiter and adding a colon between the class and method name:
1. 800ms to run JohnKary\\PHPUnit\\Listener\\Tests\\SomeSlowTest::testWithDataProvider with data set "Rock"
An individual slow test case can now be re-run by copying and pasting the output into a new command:
vendor/bin/phpunit --filter 'JohnKary\\PHPUnit\\Listener\\Tests\\SomeSlowTest::testWithDataProvider with data set "Rock"'
Note that PHPUnit uses single quotes for the --filter
option value. See the --filter option documentation for all supported matching patterns.