Skip to content

Commit 3408549

Browse files
committed
Normalize heredoc line endings in test
Heredocs may contain platform-specific line endings on Windows. Normalize expected value to match the normalized context output.
1 parent 0ae5692 commit 3408549

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/Unit/LaravelLogs/LaravelLogsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,11 @@
311311

312312
$log = new LaravelLog($logText);
313313

314+
// Normalize expected value for cross-platform comparison (heredocs may have platform line endings)
315+
$expectedStackTrace = str_replace(["\r\n", "\r"], "\n", $stackTrace);
316+
314317
expect($log->context)->toHaveKey('exception')
315-
->and($log->context['exception'])->toBe($stackTrace)
318+
->and($log->context['exception'])->toBe($expectedStackTrace)
316319
->and($log->context['exception'])->toContain('/vendor/symfony/http-kernel/')
317320
->and($log->context['exception'])->toContain('/vendor/laravel/framework/');
318321
});

0 commit comments

Comments
 (0)