From 88b778a6f3889ac97ec086d37329c152747254f1 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 29 Nov 2024 17:32:19 +0800 Subject: [PATCH 1/2] wip Signed-off-by: Mior Muhammad Zaki --- src/Foundation/Actions/CreateVendorSymlink.php | 2 +- src/Workbench/Actions/AddAssetSymlinkFolders.php | 4 ++-- src/Workbench/Actions/RemoveAssetSymlinkFolders.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Foundation/Actions/CreateVendorSymlink.php b/src/Foundation/Actions/CreateVendorSymlink.php index 74014681..64ef79ef 100644 --- a/src/Foundation/Actions/CreateVendorSymlink.php +++ b/src/Foundation/Actions/CreateVendorSymlink.php @@ -20,7 +20,7 @@ final class CreateVendorSymlink * @param string $workingPath */ public function __construct( - public string $workingPath + protected string $workingPath ) {} /** diff --git a/src/Workbench/Actions/AddAssetSymlinkFolders.php b/src/Workbench/Actions/AddAssetSymlinkFolders.php index 066ecf6f..7ff6dc76 100644 --- a/src/Workbench/Actions/AddAssetSymlinkFolders.php +++ b/src/Workbench/Actions/AddAssetSymlinkFolders.php @@ -21,8 +21,8 @@ final class AddAssetSymlinkFolders * @param \Orchestra\Testbench\Contracts\Config $config */ public function __construct( - public Filesystem $files, - public ConfigContract $config + protected Filesystem $files, + protected ConfigContract $config ) {} /** diff --git a/src/Workbench/Actions/RemoveAssetSymlinkFolders.php b/src/Workbench/Actions/RemoveAssetSymlinkFolders.php index 6f19f1ac..d1789118 100644 --- a/src/Workbench/Actions/RemoveAssetSymlinkFolders.php +++ b/src/Workbench/Actions/RemoveAssetSymlinkFolders.php @@ -20,8 +20,8 @@ final class RemoveAssetSymlinkFolders * @param \Orchestra\Testbench\Contracts\Config $config */ public function __construct( - public Filesystem $files, - public ConfigContract $config + protected Filesystem $files, + protected ConfigContract $config ) {} /** From aa786086a2845c7d4be12f3d86e09bb55c873e37 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Sat, 30 Nov 2024 10:09:27 +0800 Subject: [PATCH 2/2] wip Signed-off-by: Mior Muhammad Zaki --- src/Foundation/Console/Concerns/CopyTestbenchFiles.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Foundation/Console/Concerns/CopyTestbenchFiles.php b/src/Foundation/Console/Concerns/CopyTestbenchFiles.php index 633bb750..5ac6f25c 100644 --- a/src/Foundation/Console/Concerns/CopyTestbenchFiles.php +++ b/src/Foundation/Console/Concerns/CopyTestbenchFiles.php @@ -89,10 +89,17 @@ protected function copyTestbenchDotEnvFile( $testbenchEnvFilename = $this->testbenchEnvironmentFile(); $configurationFile = LazyCollection::make(static function () use ($testbenchEnvFilename) { + $defaultTestbenchEnvFilename = '.env'; + yield $testbenchEnvFilename; yield "{$testbenchEnvFilename}.example"; yield "{$testbenchEnvFilename}.dist"; - })->map(static fn ($file) => join_paths($workingPath, $file)) + + yield $defaultTestbenchEnvFilename; + yield "{$defaultTestbenchEnvFilename}.example"; + yield "{$defaultTestbenchEnvFilename}.dist"; + })->unique() + ->map(static fn ($file) => join_paths($workingPath, $file)) ->filter(static fn ($file) => $filesystem->isFile($file)) ->first();