diff --git a/.env.example b/.env.example index 9424ef59..dd5c559c 100644 --- a/.env.example +++ b/.env.example @@ -67,6 +67,7 @@ MAIL_ENCRYPTION = ssl CACHE_DRIVER = file SESSION_DRIVER = file QUEUE_DRIVER = sync +FS_DRIVER = local REDIS_HOST = 127.0.0.1 REDIS_PASSWORD = null diff --git a/.env.testing b/.env.testing index c7cc58d5..48311683 100644 --- a/.env.testing +++ b/.env.testing @@ -29,6 +29,7 @@ MAIL_ENCRYPTION = ssl CACHE_DRIVER = array SESSION_DRIVER = array QUEUE_DRIVER = sync +FS_DRIVER = memory REDIS_HOST = 127.0.0.1 REDIS_PASSWORD = null diff --git a/app/Providers/MemoryServiceProvider.php b/app/Providers/MemoryServiceProvider.php new file mode 100644 index 00000000..18e7b351 --- /dev/null +++ b/app/Providers/MemoryServiceProvider.php @@ -0,0 +1,23 @@ + [ - 'driver' => 'local', + 'driver' => menv('FS_DRIVER', 'local'), 'root' => storage_path('textures'), 'visibility' => 'public', ], @@ -70,6 +70,10 @@ return [ 'visibility' => 'public', ], + 'testing' => [ + 'driver' => 'memory' + ], + 's3' => [ 'driver' => 's3', 'key' => 'your-key', diff --git a/storage/testing/.gitignore b/storage/testing/.gitignore index e8e3c93f..d6b7ef32 100644 --- a/storage/testing/.gitignore +++ b/storage/testing/.gitignore @@ -1,3 +1,2 @@ * -!textures !.gitignore diff --git a/storage/testing/textures/.gitignore b/storage/testing/textures/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/storage/testing/textures/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/TextureControllerTest.php b/tests/TextureControllerTest.php index c497695a..45636ba4 100644 --- a/tests/TextureControllerTest.php +++ b/tests/TextureControllerTest.php @@ -11,24 +11,6 @@ class TextureControllerTest extends TestCase { use DatabaseTransactions; - protected function setUp() - { - parent::setUp(); - config(['filesystems.disks.textures.root' => storage_path('testing/textures')]); - } - - protected function tearDown() - { - collect(Storage::disk('textures')->files()) - ->reject(function ($filename) { - return $filename == '.gitignore'; - }) - ->each(function ($filename) { - Storage::disk('textures')->delete($filename); - }); - parent::tearDown(); - } - public function testJson() { $steve = factory(Texture::class)->create();