Last active
May 31, 2020 19:54
-
-
Save richartkeil/ea3e257df176fabda8cda31d88bfadb0 to your computer and use it in GitHub Desktop.
Laravel Storage and Parallel Testing - Storage Facade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
public static function fake($disk = null, array $config = []) { | |
$disk = $disk ?: static::$app['config']->get('filesystems.default'); | |
(new Filesystem)->cleanDirectory( | |
$root = storage_path('framework/testing/disks/'.$disk) | |
); | |
static::set($disk, $fake = static::createLocalDriver(array_merge($config, [ | |
'root' => $root, | |
]))); | |
return $fake; | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment