public function testSaveConfigFile() { $configFile = new ConfigFile('/path'); $this->serializer->expects($this->once())->method('serializeConfigFile')->with($configFile)->willReturn('SERIALIZED'); $this->backend->expects($this->once())->method('write')->with('/path', 'SERIALIZED'); $this->storage->saveConfigFile($configFile); }
/** * Saves a configuration file. * * The configuration file is saved to the same path that it was read from. * * @param ConfigFile $configFile The configuration file to save. * * @throws StorageException If the file cannot be written. */ public function saveConfigFile(ConfigFile $configFile) { $serialized = $this->serializer->serializeConfigFile($configFile); $this->storage->write($configFile->getPath(), $serialized); if ($this->factoryManager) { $this->factoryManager->autoGenerateFactoryClass(); } }