From 2eca627c63e34efa9466a48ebef38642fb8333c9 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 24 Oct 2023 06:52:03 +0800 Subject: [PATCH] wip Signed-off-by: Mior Muhammad Zaki --- tests/Commands/GeneratorCommandTest.php | 13 +++++++------ tests/Concerns/UsesGeneratorOverridesTest.php | 3 ++- tests/PresetManagerTest.php | 5 +++-- tests/Presets/LaravelPresetTest.php | 5 +++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/Commands/GeneratorCommandTest.php b/tests/Commands/GeneratorCommandTest.php index 7715546..e6af20e 100644 --- a/tests/Commands/GeneratorCommandTest.php +++ b/tests/Commands/GeneratorCommandTest.php @@ -5,6 +5,7 @@ use Orchestra\Testbench\Concerns\InteractsWithPublishedFiles; use Orchestra\Testbench\Concerns\WithWorkbench; use Orchestra\Testbench\TestCase; +use PHPUnit\Framework\Attributes\Test; class GeneratorCommandTest extends TestCase { @@ -16,7 +17,7 @@ class GeneratorCommandTest extends TestCase 'tests/Feature/Value/FooTest.php', ]; - /** @test */ + #[Test] public function it_can_generate_class_file() { $this->artisan('make:code', ['name' => 'Value/Foo']) @@ -28,7 +29,7 @@ public function it_can_generate_class_file() ], 'app/Value/Foo.php'); } - /** @test */ + #[Test] public function it_can_generate_class_file_with_phpunit_test() { $this->artisan('make:code', ['name' => 'Value/Foo', '--test' => true]) @@ -46,7 +47,7 @@ public function it_can_generate_class_file_with_phpunit_test() ], 'tests/Feature/Value/FooTest.php'); } - /** @test */ + #[Test] public function it_can_generate_class_file_with_pest_test() { $this->artisan('make:code', ['name' => 'Value/Foo', '--pest' => true]) @@ -64,7 +65,7 @@ public function it_can_generate_class_file_with_pest_test() ], 'tests/Feature/Value/FooTest.php'); } - /** @test */ + #[Test] public function it_can_generate_class_file_when_file_already_exist_using_force_option() { file_put_contents(base_path('app/Value/Foo.php'), 'artisan('make:code', ['name' => '__halt_compiler']) @@ -86,7 +87,7 @@ public function it_cannot_generate_class_file_given_reserved_name() ->assertFailed(); } - /** @test */ + #[Test] public function it_cannot_generate_class_file_when_file_already_exist() { file_put_contents(base_path('app/Value/Foo.php'), 'app[PresetManager::class]; @@ -17,7 +18,7 @@ public function it_can_be_resolved() $this->assertSame('laravel', $manager->getDefaultDriver()); } - /** @test */ + #[Test] public function it_can_override_default_driver() { $manager = $this->app[PresetManager::class]; diff --git a/tests/Presets/LaravelPresetTest.php b/tests/Presets/LaravelPresetTest.php index beb8e73..0ce376b 100644 --- a/tests/Presets/LaravelPresetTest.php +++ b/tests/Presets/LaravelPresetTest.php @@ -7,6 +7,7 @@ use Orchestra\Canvas\Core\Presets\Laravel; use Orchestra\Testbench\Concerns\WithWorkbench; use Orchestra\Testbench\TestCase; +use PHPUnit\Framework\Attributes\Test; class LaravelPresetTest extends TestCase { @@ -32,7 +33,7 @@ protected function setUp(): void parent::setUp(); } - /** @test */ + #[Test] public function it_can_be_resolved() { $preset = $this->app[PresetManager::class]->driver('laravel'); @@ -62,7 +63,7 @@ public function it_can_be_resolved() $this->assertSame('Illuminate\Foundation\Auth\User', $preset->userProviderModel()); } - /** @test */ + #[Test] public function it_available_as_default_driver() { $preset = $this->app[PresetManager::class]->driver();