Skip to content

Commit 02d58f0

Browse files
committed
Use existing cachedConfigurationForWorkbench() method
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
1 parent 483bf26 commit 02d58f0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/Workbench/ActionsTest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,37 @@ protected function setUp(): void
4343
#[Test]
4444
public function it_does_not_wipe_target_directory_while_recreating_asset_symlink()
4545
{
46-
(new AddAssetSymlinkFolders($this->filesystem, $this->getConfig()))->handle();
46+
(new AddAssetSymlinkFolders($this->filesystem, static::cachedConfigurationForWorkbench()))->handle();
4747

4848
$this->assertDirectoryExists(join_paths(default_skeleton_path(), 'storage', 'framework'));
4949
}
5050

5151
#[Test]
5252
public function it_does_not_wipe_target_directory_while_removing_asset_symlink()
5353
{
54-
(new RemoveAssetSymlinkFolders($this->filesystem, $this->getConfig()))->handle();
54+
(new RemoveAssetSymlinkFolders($this->filesystem, static::cachedConfigurationForWorkbench()))->handle();
5555

5656
$this->assertDirectoryExists(join_paths(default_skeleton_path(), 'storage', 'framework'));
5757
}
5858

59+
/**
60+
* Ensure symlink directory exists for the test.
61+
*
62+
* @return void
63+
*/
5964
protected function ensureSymlinkExists(): void
6065
{
6166
if (! is_symlink(workbench_path('storage'))) {
6267
$this->filesystem->link(default_skeleton_path('storage'), workbench_path('storage'));
6368
}
6469
}
6570

66-
protected function getConfig(): Config
71+
/**
72+
* Define or get the cached uses for test case.
73+
*
74+
* @return \Orchestra\Testbench\Contracts\Config
75+
*/
76+
public static function cachedConfigurationForWorkbench()
6777
{
6878
return new Config([
6979
'workbench' => [

0 commit comments

Comments
 (0)