Skip to content

Commit

Permalink
Merge pull request phpmyadmin#19293 from kamil-tekiela/Fix-windows-tests
Browse files Browse the repository at this point in the history
Use DIRECTORY_SEPARATOR in tests
  • Loading branch information
MauricioFauth authored Sep 23, 2024
2 parents f668701 + 42a530f commit d78a624
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/unit/Error/ErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use PHPUnit\Framework\Attributes\DataProvider;

use function preg_match;
use function str_replace;

use const DIRECTORY_SEPARATOR;

#[CoversClass(Error::class)]
class ErrorTest extends AbstractTestCase
Expand Down Expand Up @@ -64,7 +67,9 @@ public function testSetFileWithValidFiles(string $file, string $expected): void
{
$this->object->setFile($file);
$filePath = $this->object->getFile();
self::assertStringStartsWith('./', $filePath);
self::assertStringStartsWith('.' . DIRECTORY_SEPARATOR, $filePath);
/** @psalm-var non-empty-string $expected */
$expected = str_replace('/', DIRECTORY_SEPARATOR, $expected);
self::assertStringEndsWith($expected, $filePath);
}

Expand Down

0 comments on commit d78a624

Please sign in to comment.