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 Jan 8, 2024
1 parent 3af8fb6 commit db7f18d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 7 additions & 5 deletions tests/Concerns/UsesGeneratorOverridesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;

use function Illuminate\Filesystem\join_paths;

class UsesGeneratorOverridesTest extends TestCase
{
/**
Expand All @@ -20,13 +22,13 @@ protected function setUp(): void
$filesystem = new Filesystem();

$this->afterApplicationCreated(static function () use ($filesystem) {
$filesystem->ensureDirectoryExists(base_path('app/Events'));
$filesystem->ensureDirectoryExists(base_path('app/Models'));
$filesystem->ensureDirectoryExists(join_paths(base_path('app'), 'Events'));
$filesystem->ensureDirectoryExists(join_paths(base_path('app'), 'Models'));
});

$this->beforeApplicationDestroyed(static function () use ($filesystem) {
$filesystem->deleteDirectory(base_path('app/Events'));
$filesystem->deleteDirectory(base_path('app/Models'));
$filesystem->deleteDirectory(join_paths(base_path('app'), 'Events'));
$filesystem->deleteDirectory(join_paths(base_path('app'), 'Models'));
});

parent::setUp();
Expand All @@ -39,7 +41,7 @@ public function it_can_get_qualify_model_class()

$this->assertSame([
'user-model' => 'App\Models\User',
'welcome-view' => $this->app->joinPaths(base_path('resources'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'welcome.blade.php')),
'welcome-view' => join_paths(base_path('resources'), 'views', 'welcome.blade.php'),
'possible-models' => [],
'possible-events' => [],
], $stub->toArray());
Expand Down
10 changes: 6 additions & 4 deletions tests/Presets/LaravelPresetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;

use function Illuminate\Filesystem\join_paths;

class LaravelPresetTest extends TestCase
{
use WithWorkbench;
Expand All @@ -21,13 +23,13 @@ protected function setUp(): void
$filesystem = new Filesystem();

$this->afterApplicationCreated(static function () use ($filesystem) {
$filesystem->ensureDirectoryExists(base_path('app/Events'));
$filesystem->ensureDirectoryExists(base_path('app/Models'));
$filesystem->ensureDirectoryExists(join_paths(base_path('app'), 'Events'));
$filesystem->ensureDirectoryExists(join_paths(base_path('app'), 'Models'));
});

$this->beforeApplicationDestroyed(static function () use ($filesystem) {
$filesystem->deleteDirectory(base_path('app/Events'));
$filesystem->deleteDirectory(base_path('app/Models'));
$filesystem->deleteDirectory(join_paths(base_path('app'), 'Events'));
$filesystem->deleteDirectory(join_paths(base_path('app'), 'Models'));
});

parent::setUp();
Expand Down

0 comments on commit db7f18d

Please sign in to comment.