From acc0987490a92ad3ac7933d83214609dad539f93 Mon Sep 17 00:00:00 2001 From: Jacob Baker-Kretzmar Date: Tue, 3 Oct 2023 10:41:57 -0400 Subject: [PATCH] Wip --- tests/Unit/CommandRouteGeneratorTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Unit/CommandRouteGeneratorTest.php b/tests/Unit/CommandRouteGeneratorTest.php index 932d57ae..e117b376 100644 --- a/tests/Unit/CommandRouteGeneratorTest.php +++ b/tests/Unit/CommandRouteGeneratorTest.php @@ -151,9 +151,12 @@ public function can_generate_dts_file() Artisan::call('ziggy:generate', ['--types' => true]); + dump(file_get_contents(__DIR__ . '/../fixtures/ziggy.d.ts')); + dump(file_get_contents(base_path('resources/js/ziggy.d.ts'))); + file_put_contents( base_path('resources/js/ziggy.d.ts'), - preg_replace('/(\n\r?)/', "\n", file_get_contents(base_path('resources/js/ziggy.d.ts'))), + str_replace("\r", '', file_get_contents(base_path('resources/js/ziggy.d.ts'))), ); $this->assertFileEquals('./tests/fixtures/ziggy.d.ts', base_path('resources/js/ziggy.d.ts')); @@ -173,10 +176,13 @@ public function can_generate_dts_file_with_scoped_bindings() Artisan::call('ziggy:generate', ['--types' => true]); + dump(file_get_contents(__DIR__ . '/../fixtures/ziggy-7.d.ts')); + dump(file_get_contents(base_path('resources/js/ziggy.d.ts'))); + // Normalize line endings (on Windows, `json_encode` uses Windows line endings) file_put_contents( base_path('resources/js/ziggy.d.ts'), - preg_replace('/(\n\r?)/', "\n", file_get_contents(base_path('resources/js/ziggy.d.ts'))), + str_replace("\r", '', file_get_contents(base_path('resources/js/ziggy.d.ts'))), ); $this->assertFileEquals('./tests/fixtures/ziggy-7.d.ts', base_path('resources/js/ziggy.d.ts'));