Skip to content

Commit

Permalink
fixed phpunit version incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ogmueller committed Mar 18, 2024
1 parent bb14667 commit d253675
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/Util/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use PHPUnit\Event\TestSuite\TestSuite;
use PHPUnit\Event\TestSuite\TestSuiteForTestClass;
use PHPUnit\Metadata\MetadataCollection;
use PHPUnit\Runner\Version;

trait Helper
{
Expand Down Expand Up @@ -133,7 +134,19 @@ final protected static function fakeGarbageCollectorStatus(
?bool $protected = false,
?bool $full = true,
?int $bufferSize = 0,
): \PHPUnit\Event\Telemetry\GarbageCollectorStatus {
): GarbageCollectorStatus {
if( version_compare(Version::id(), '10.3', '<')) {
return new GarbageCollectorStatus(
$runs,
$collected,
$threshold,
$roots,
$running,
$protected,
$full,
);
}

return new GarbageCollectorStatus(
$runs,
$collected,
Expand Down

0 comments on commit d253675

Please sign in to comment.