/** * Sets a clean storage driver with default substorage path */ private function refreshDriver() { // Inject new file driver and mock config $this->fileStorageDriver = new FileDriver(); $this->fileStorageDriver->setConfigKey('mocked.config.key'); Config::set('mocked.config.key', array('storageSubfolder' => $this->fileStorageFolderRelativeToStoragePath)); }
public function testUpdateStorageDriver() { //We first set a storage driver that will use default configuration, and check that config is indeed being used $fileDriver = new FileDriver(); $configKey = $fileDriver->getConfigKey(); TestModel::setStorageDriver($fileDriver); $this->assertEquals(TestModel::getStorageDriverInstance()->getConfigKey(), $configKey); //Update configuration & driver, which should update driver configuration automatically $this->mockStorageConfiguration($configKey, array('foo' => 'bar')); TestModel::setStorageDriver($fileDriver); $this->assertEquals(TestModel::getStorageDriverInstance()->getConfigKey(), $configKey); }