Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Create storage fakes with custom configuration #29999

Merged
merged 3 commits into from
Sep 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use static keyword instead of self in Storage facade
All the facades in the framework are using the `static` keyword instead of `self`, so the Storage facade should behave the same way.
  • Loading branch information
sebdesign committed Sep 15, 2019
commit e7723d17caacd06031f3479a8e8303b514d90fc7
8 changes: 4 additions & 4 deletions src/Illuminate/Support/Facades/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class Storage extends Facade
*/
public static function fake($disk = null, array $config = [])
{
$disk = $disk ?: self::$app['config']->get('filesystems.default');
$disk = $disk ?: static::$app['config']->get('filesystems.default');

(new Filesystem)->cleanDirectory(
$root = storage_path('framework/testing/disks/'.$disk)
);

static::set($disk, $fake = self::createLocalDriver(array_merge($config, [
static::set($disk, $fake = static::createLocalDriver(array_merge($config, [
'root' => $root,
])));

Expand All @@ -42,9 +42,9 @@ public static function fake($disk = null, array $config = [])
*/
public static function persistentFake($disk = null, array $config = [])
{
$disk = $disk ?: self::$app['config']->get('filesystems.default');
$disk = $disk ?: static::$app['config']->get('filesystems.default');

static::set($disk, $fake = self::createLocalDriver(array_merge($config, [
static::set($disk, $fake = static::createLocalDriver(array_merge($config, [
'root' => storage_path('framework/testing/disks/'.$disk),
])));

Expand Down