diff --git a/src/Illuminate/Support/Facades/Storage.php b/src/Illuminate/Support/Facades/Storage.php index 485abaa7dffe..33af10d7b87a 100644 --- a/src/Illuminate/Support/Facades/Storage.php +++ b/src/Illuminate/Support/Facades/Storage.php @@ -10,9 +10,10 @@ class Storage extends Facade { /** - * Replace the given disk with a local, testing disk. + * Replace the given disk with a local testing disk. * * @param string $disk + * * @return void */ public static function fake($disk) @@ -24,6 +25,19 @@ public static function fake($disk) static::set($disk, self::createLocalDriver(['root' => $root])); } + /** + * Replace the given disk with a persistent local testing disk. + * + * @param string $disk + * @return void + */ + public static function persistentFake($disk) + { + static::set($disk, self::createLocalDriver([ + 'root' => storage_path('framework/testing/disks/' . $disk) + ])); + } + /** * Get the registered name of the component. *