protected function registerStorageManager() { $this->app['simple-photo.storage-manager'] = $this->app->share(function ($app) { $storageManager = new StorageManager(); $storageLocations = $app['config']['morrelinko/laravel-simple-photo::storage_locations']; foreach ($storageLocations as $storageName => $storageLocation) { $storageManager->add($storageName, $app['simple-photo.storage-factory']->createStorage($storageLocation['storage'], $storageLocation['options'])); } $storageManager->setDefault($app['config']['morrelinko/laravel-simple-photo::default_storage']); $fallbackStorage = $app['config']['morrelinko/laravel-simple-photo::fallback_storage']; if ($fallbackStorage) { $storageManager->setFallback($storageManager->get($fallbackStorage)); } return $storageManager; }); }
public function testFallback() { $this->storageManager->setFallback(new MemoryStorage()); $this->assertTrue($this->storageManager->hasFallback()); }