public function testSaveRootPackageFile() { $baseConfig = new Config(); $packageFile = new RootPackageFile(null, '/path', $baseConfig); $this->serializer->expects($this->once())->method('serializeRootPackageFile')->with($packageFile)->willReturn('SERIALIZED'); $this->backend->expects($this->once())->method('write')->with('/path', 'SERIALIZED'); $this->storage->saveRootPackageFile($packageFile); }
/** * Saves a root package file. * * The package file is saved to the same path that it was read from. * * @param RootPackageFile $packageFile The package file to save. * * @throws StorageException If the file cannot be written. */ public function saveRootPackageFile(RootPackageFile $packageFile) { $serialized = $this->serializer->serializeRootPackageFile($packageFile); $this->storage->write($packageFile->getPath(), $serialized); if ($this->factoryManager) { $this->factoryManager->autoGenerateFactoryClass(); } }