Skip to content

Commit

Permalink
Merge branch '8.x'
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Oct 30, 2023
2 parents 9d4063d + 2eca627 commit 638d439
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 1 addition & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@
"illuminate/filesystem": "^11.0"
},
"require-dev": {
"fakerphp/faker": "^1.21",
"laravel/framework": "^11.0",
"laravel/pint": "^1.6",
"mockery/mockery": "^1.5.1",
"orchestra/testbench-core": "^9.0",
"orchestra/workbench": "dev-next",
"orchestra/testbench": "^9.0",
"phpstan/phpstan": "^1.10.6",
"phpunit/phpunit": "^10.1",
"symfony/yaml": "^7.0"
},
"config": {
Expand Down
13 changes: 7 additions & 6 deletions tests/Commands/GeneratorCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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'])
Expand All @@ -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])
Expand All @@ -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])
Expand All @@ -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'), '<?php '.PHP_EOL);
Expand All @@ -78,15 +79,15 @@ public function it_can_generate_class_file_when_file_already_exist_using_force_o
], 'app/Value/Foo.php');
}

/** @test */
#[Test]
public function it_cannot_generate_class_file_given_reserved_name()
{
$this->artisan('make:code', ['name' => '__halt_compiler'])
->expectsOutputToContain('The name "__halt_compiler" is reserved by PHP.')
->assertFailed();
}

/** @test */
#[Test]
public function it_cannot_generate_class_file_when_file_already_exist()
{
file_put_contents(base_path('app/Value/Foo.php'), '<?php '.PHP_EOL);
Expand Down
3 changes: 2 additions & 1 deletion tests/Concerns/UsesGeneratorOverridesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Orchestra\Canvas\Core\PresetManager;
use Orchestra\Canvas\Core\Presets\Preset;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;

class UsesGeneratorOverridesTest extends TestCase
{
Expand All @@ -31,7 +32,7 @@ protected function setUp(): void
parent::setUp();
}

/** @test */
#[Test]
public function it_can_get_qualify_model_class()
{
$stub = new UsesGeneratorOverridesTestStub();
Expand Down
5 changes: 3 additions & 2 deletions tests/PresetManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
use Illuminate\Support\Manager;
use Orchestra\Canvas\Core\PresetManager;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;

class PresetManagerTest extends TestCase
{
/** @test */
#[Test]
public function it_can_be_resolved()
{
$manager = $this->app[PresetManager::class];
Expand All @@ -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];
Expand Down
5 changes: 3 additions & 2 deletions tests/Presets/LaravelPresetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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');
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 638d439

Please sign in to comment.