From 2399f9a82f27d1ce5b1b666320a6b29d95fa4b72 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Wed, 27 Dec 2023 21:06:09 +0800 Subject: [PATCH] wip Signed-off-by: Mior Muhammad Zaki --- tests/Commands/GeneratorCommandTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/Commands/GeneratorCommandTest.php b/tests/Commands/GeneratorCommandTest.php index 5e054c3..967769e 100644 --- a/tests/Commands/GeneratorCommandTest.php +++ b/tests/Commands/GeneratorCommandTest.php @@ -5,8 +5,8 @@ use Orchestra\Testbench\Concerns\InteractsWithPublishedFiles; use Orchestra\Testbench\Concerns\WithWorkbench; use Orchestra\Testbench\TestCase; +use PHPUnit\Framework\Attributes\RequiresOperatingSystem; use PHPUnit\Framework\Attributes\Test; - use function Illuminate\Filesystem\join_paths; class GeneratorCommandTest extends TestCase @@ -90,6 +90,7 @@ public function it_cannot_generate_class_file_given_reserved_name() } #[Test] + #[RequiresOperatingSystem('Linux|DAR')] public function it_cannot_generate_class_file_when_file_already_exist() { file_put_contents(base_path(join_paths('app', 'Value', 'Foo.php')), 'expectsOutputToContain('class [app/Value/Foo.php] already exists!') ->assertFailed(); } + + #[Test] + #[RequiresOperatingSystem('Windows')] + public function it_cannot_generate_class_file_when_file_already_exist_on_windows() + { + file_put_contents(base_path(join_paths('app', 'Value', 'Foo.php')), 'artisan('make:code', ['name' => 'Value/Foo']) + ->expectsOutputToContain('class [app\Value\Foo.php] already exists!') + ->assertFailed(); + } }