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 d253675 commit 36bf46d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 10 deletions.
52 changes: 52 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,57 @@
<code><![CDATA[$name]]></code>
<code><![CDATA[$testData]]></code>
</ArgumentTypeCoercion>
<InvalidArgument>
<code><![CDATA[$full]]></code>
<code><![CDATA[$protected]]></code>
<code><![CDATA[$running]]></code>
</InvalidArgument>
<TooFewArguments>
<code><![CDATA[new GarbageCollectorStatus(
$runs,
$collected,
$threshold,
$roots,
$running,
$protected,
$full,
)]]></code>
<code><![CDATA[new GarbageCollectorStatus(
$runs,
$collected,
$threshold,
$roots,
$running,
$protected,
$full,
)]]></code>
<code><![CDATA[new GarbageCollectorStatus(
$runs,
$collected,
$threshold,
$roots,
$running,
$protected,
$full,
)]]></code>
<code><![CDATA[new GarbageCollectorStatus(
$runs,
$collected,
$threshold,
$roots,
$running,
$protected,
$full,
)]]></code>
<code><![CDATA[new GarbageCollectorStatus(
$runs,
$collected,
$threshold,
$roots,
$running,
$protected,
$full,
)]]></code>
</TooFewArguments>
</file>
</files>
21 changes: 11 additions & 10 deletions test/Util/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ final protected static function fakeGarbageCollectorStatus(
?bool $full = true,
?int $bufferSize = 0,
): GarbageCollectorStatus {
if( version_compare(Version::id(), '10.3', '<')) {
if (\version_compare(Version::id(), '10.3', '<')) {
return new GarbageCollectorStatus(
$runs,
$collected,
Expand All @@ -144,6 +144,7 @@ final protected static function fakeGarbageCollectorStatus(
$running,
$protected,
$full,
$bufferSize,
);
}

Expand All @@ -170,9 +171,9 @@ final protected static function fakeTelemetrySnapshot(
?GarbageCollectorStatus $garbageCollectorStatus = null,
): Snapshot {
return new Snapshot(
$time ?? HRTime::fromSecondsAndNanoseconds(0, 0),
$memoryUsage ?? MemoryUsage::fromBytes(0),
$peakMemoryUsage ?? MemoryUsage::fromBytes(0),
$time ?? HRTime::fromSecondsAndNanoseconds(0, 0),
$memoryUsage ?? MemoryUsage::fromBytes(0),
$peakMemoryUsage ?? MemoryUsage::fromBytes(0),
$garbageCollectorStatus ?? self::fakeGarbageCollectorStatus(),
);
}
Expand All @@ -185,10 +186,10 @@ final protected static function fakeTelemetryInfo(
?MemoryUsage $peakMemoryUsage = null,
): Info {
return new Info(
$snapshot ?? self::fakeTelemetrySnapshot(),
$duration ?? Duration::fromSecondsAndNanoseconds(0, 0),
$memoryUsage ?? MemoryUsage::fromBytes(0),
$time ?? Duration::fromSecondsAndNanoseconds(0, 0),
$snapshot ?? self::fakeTelemetrySnapshot(),
$duration ?? Duration::fromSecondsAndNanoseconds(0, 0),
$memoryUsage ?? MemoryUsage::fromBytes(0),
$time ?? Duration::fromSecondsAndNanoseconds(0, 0),
$peakMemoryUsage ?? MemoryUsage::fromBytes(0),
);
}
Expand All @@ -199,7 +200,7 @@ final protected static function fakeEventTestFinished(
int $result = 1,
): Finished {
return new Finished(
$info ?? self::fakeTelemetryInfo(),
$info ?? self::fakeTelemetryInfo(),
$testMethod ?? self::fakeTestMethod(),
$result,
);
Expand Down Expand Up @@ -279,7 +280,7 @@ final protected static function fakeEventTestSuiteFinished(
?TestSuite $testSuite = null,
): TestSuiteFinished {
return new TestSuiteFinished(
$info ?? self::fakeTelemetryInfo(),
$info ?? self::fakeTelemetryInfo(),
$testSuite ?? self::fakeTestSuite(),
);
}
Expand Down

0 comments on commit 36bf46d

Please sign in to comment.