From 9dc11f20b3168d4349a23316fab9ab30302b9949 Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Sun, 22 Oct 2023 19:51:55 -0400 Subject: [PATCH] Expect forward slashes in output paths regardless of OS. --- tests/Generator/MakeFactoryTest.php | 4 +++- tests/Generator/MakeModelTest.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Generator/MakeFactoryTest.php b/tests/Generator/MakeFactoryTest.php index b50ed6c..ee8f70e 100644 --- a/tests/Generator/MakeFactoryTest.php +++ b/tests/Generator/MakeFactoryTest.php @@ -33,9 +33,11 @@ Artisan::call("ddd:factory {$domain->dotName} {$modelName}"); + $outputPath = str_replace('\\', '/', $domainFactory->path); + expect(Artisan::output())->when( Feature::IncludeFilepathInGeneratorCommandOutput->exists(), - fn ($output) => $output->toContain($domainFactory->path), + fn ($output) => $output->toContain($outputPath), ); expect(file_exists($expectedFactoryPath))->toBeTrue( diff --git a/tests/Generator/MakeModelTest.php b/tests/Generator/MakeModelTest.php index 843c929..55628ae 100644 --- a/tests/Generator/MakeModelTest.php +++ b/tests/Generator/MakeModelTest.php @@ -76,9 +76,11 @@ '--factory' => true, ]); + $outputPath = str_replace('\\', '/', $domainModel->path); + expect(Artisan::output())->when( Feature::IncludeFilepathInGeneratorCommandOutput->exists(), - fn ($output) => $output->toContain($domainModel->path), + fn ($output) => $output->toContain($outputPath), ); expect(file_exists($expectedModelPath))->toBeTrue();