Right now the report is printed before phpunit/phpunit has printed its own output - which feels like a violation to me.
Before
See https://github.com/sebastianbergmann/phpunit/blob/10.0.0/src/TextUI/TestRunner.php#L65.
PHPUnit 10.5.63 by Sebastian Bergmann and contributors.
Runtime: PHP 8.1.34
Configuration: /app/work/test/Phar/PHPUnit10/phpunit.xml
Extension: ergebnis/phpunit-slow-test-detector 2.23.0
Random Seed: 1771838601
..... 5 / 5 (100%)
Detected 4 tests where the duration exceeded the global maximum duration (0.050).
# Duration Test
----------------------------------------------------------------------------------------------------------------------------------
1 0.156 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsOneHundredAndFiftyMilliseconds
2 0.130 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsOneHundredAndTwentyFiveMilliseconds
3 0.104 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsOneHundredMilliseconds
4 0.077 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsSeventyFiveMilliseconds
----------------------------------------------------------------------------------------------------------------------------------
0.000
└─── seconds
Time: 00:00.473, Memory: 8.00 MB
OK (5 tests, 5 assertions)
After
See https://github.com/sebastianbergmann/phpunit/blob/10.0.0/src/TextUI/Application.php#L175.
PHPUnit 10.5.63 by Sebastian Bergmann and contributors.
Runtime: PHP 8.1.34
Configuration: /app/work/test/Phar/PHPUnit10/phpunit.xml
Extension: ergebnis/phpunit-slow-test-detector 2.23.0
Random Seed: 1771838601
..... 5 / 5 (100%)
Time: 00:00.473, Memory: 8.00 MB
OK (5 tests, 5 assertions)
Detected 4 tests where the duration exceeded the global maximum duration (0.050).
# Duration Test
----------------------------------------------------------------------------------------------------------------------------------
1 0.156 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsOneHundredAndFiftyMilliseconds
2 0.130 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsOneHundredAndTwentyFiveMilliseconds
3 0.104 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsOneHundredMilliseconds
4 0.077 Ergebnis\PHPUnit\SlowTestDetector\Test\Phar\PHPUnit10\SleeperTest::testSleeperSleepsSeventyFiveMilliseconds
----------------------------------------------------------------------------------------------------------------------------------
0.000
└─── seconds
Right now the report is printed before
phpunit/phpunithas printed its own output - which feels like a violation to me.Before
See https://github.com/sebastianbergmann/phpunit/blob/10.0.0/src/TextUI/TestRunner.php#L65.
After
See https://github.com/sebastianbergmann/phpunit/blob/10.0.0/src/TextUI/Application.php#L175.