Skip to content

Commit

Permalink
Fix LevelsTestCase for PHPUnit 10
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 8, 2023
1 parent 34dfd6a commit fa5d5f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Testing/LevelsTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private function compareFiles(string $expectedJsonFile, array $expectedMessages)
{
if (count($expectedMessages) === 0) {
try {
self::assertFileDoesNotExist($expectedJsonFile);
self::ourCustomAssertFileDoesNotExist($expectedJsonFile);
return null;
} catch (AssertionFailedError $e) {
unlink($expectedJsonFile);
Expand All @@ -192,8 +192,9 @@ private function compareFiles(string $expectedJsonFile, array $expectedMessages)
return null;
}

public static function assertFileDoesNotExist(string $filename, string $message = ''): void
public static function ourCustomAssertFileDoesNotExist(string $filename, string $message = ''): void
{
// this method is no longer called assertFileDoesNotExist because this method is final in PHPUnit 10
if (!method_exists(parent::class, 'assertFileDoesNotExist')) {
parent::assertFileNotExists($filename, $message);
return;
Expand Down

0 comments on commit fa5d5f9

Please sign in to comment.