Skip to content

Commit

Permalink
Expect forward slashes in output paths regardless of OS.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Oct 22, 2023
1 parent c830ee5 commit 9dc11f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/Generator/MakeFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion tests/Generator/MakeModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9dc11f2

Please sign in to comment.