Skip to content

Commit d78a624

Browse files
Merge pull request #19293 from kamil-tekiela/Fix-windows-tests
Use DIRECTORY_SEPARATOR in tests
2 parents f668701 + 42a530f commit d78a624

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/unit/Error/ErrorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use PHPUnit\Framework\Attributes\DataProvider;
1111

1212
use function preg_match;
13+
use function str_replace;
14+
15+
use const DIRECTORY_SEPARATOR;
1316

1417
#[CoversClass(Error::class)]
1518
class ErrorTest extends AbstractTestCase
@@ -64,7 +67,9 @@ public function testSetFileWithValidFiles(string $file, string $expected): void
6467
{
6568
$this->object->setFile($file);
6669
$filePath = $this->object->getFile();
67-
self::assertStringStartsWith('./', $filePath);
70+
self::assertStringStartsWith('.' . DIRECTORY_SEPARATOR, $filePath);
71+
/** @psalm-var non-empty-string $expected */
72+
$expected = str_replace('/', DIRECTORY_SEPARATOR, $expected);
6873
self::assertStringEndsWith($expected, $filePath);
6974
}
7075

0 commit comments

Comments
 (0)