Skip to content

Commit fa715cd

Browse files
committed
Fix path comparison in TypeError exception handling for CRLF tests
1 parent 45d966a commit fa715cd

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/TypeChecking/Boundaries/CrlfLineDriftTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,13 @@
133133
$caught = false;
134134
} catch (TypeError $e) {
135135
$caught = true;
136-
expect($e->getLine())->toBe(13)
137-
->and(str_replace('\\', '/', $e->getFile()))->toBe(str_replace('\\', '/', $crlfScriptPath));
136+
expect($e->getLine())->toBe(13);
137+
138+
$expectedPath = realpath($crlfScriptPath) !== false ? realpath($crlfScriptPath) : $crlfScriptPath;
139+
$actualPath = realpath($e->getFile()) !== false ? realpath($e->getFile()) : $e->getFile();
140+
141+
expect(strtolower(str_replace('\\', '/', (string) $actualPath)))
142+
->toBe(strtolower(str_replace('\\', '/', (string) $expectedPath)));
138143
} finally {
139144
@unlink($crlfScriptPath);
140145
@rmdir($tempDir);

0 commit comments

Comments
 (0)