From d253675b5b19b85310ae80eacec53cf77b6ad4cd Mon Sep 17 00:00:00 2001 From: "Oliver G. Mueller" Date: Mon, 18 Mar 2024 11:57:45 +0100 Subject: [PATCH] fixed phpunit version incompatibility --- test/Util/Helper.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/Util/Helper.php b/test/Util/Helper.php index 84ff328..001049c 100644 --- a/test/Util/Helper.php +++ b/test/Util/Helper.php @@ -38,6 +38,7 @@ use PHPUnit\Event\TestSuite\TestSuite; use PHPUnit\Event\TestSuite\TestSuiteForTestClass; use PHPUnit\Metadata\MetadataCollection; +use PHPUnit\Runner\Version; trait Helper { @@ -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,