Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Laravel Storage and Parallel Testing - Storage Facade
<?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