Skip to content

Commit

Permalink
[5.4] Add ability to keep old files when testing uploads [second atte…
Browse files Browse the repository at this point in the history
…mpt] (#19859)

* Add ability to keep old files when testing uploads

* Add persistentFake method

* Update Storage.php
  • Loading branch information
gocanto authored and taylorotwell committed Jul 6, 2017
1 parent c3d9de8 commit ac4e043
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Illuminate/Support/Facades/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
*
Expand Down

0 comments on commit ac4e043

Please sign in to comment.