Skip to content

Commit b5d6cee

Browse files
committed
Refactor Storage::fake to accept enum_value for disk handling
1 parent ed0237b commit b5d6cee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Support/Facades/Storage.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Illuminate\Filesystem\Filesystem;
66

7+
use function Illuminate\Support\enum_value;
8+
79
/**
810
* @method static \Illuminate\Contracts\Filesystem\Filesystem drive(string|null $name = null)
911
* @method static \Illuminate\Contracts\Filesystem\Filesystem disk(\UnitEnum|string|null $name = null)
@@ -96,7 +98,7 @@ class Storage extends Facade
9698
*/
9799
public static function fake($disk = null, array $config = [])
98100
{
99-
$root = self::getRootPath($disk = $disk ?: static::$app['config']->get('filesystems.default'));
101+
$root = self::getRootPath($disk = enum_value($disk) ?: static::$app['config']->get('filesystems.default'));
100102

101103
if ($token = ParallelTesting::token()) {
102104
$root = "{$root}_test_{$token}";

0 commit comments

Comments
 (0)