Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Dec 27, 2023
1 parent 640b63c commit 2399f9a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/Commands/GeneratorCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')), '<?php '.PHP_EOL);
Expand All @@ -98,4 +99,15 @@ public function it_cannot_generate_class_file_when_file_already_exist()
->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')), '<?php '.PHP_EOL);

$this->artisan('make:code', ['name' => 'Value/Foo'])
->expectsOutputToContain('class [app\Value\Foo.php] already exists!')
->assertFailed();
}
}

0 comments on commit 2399f9a

Please sign in to comment.