public function testAddCollection() { $this->model->addDefinition(self::INSTANCE_1, $this->getArgument()); $this->collectionMock->expects($this->any())->method('getCollection')->willReturn([self::INSTANCE_2 => $this->getArgument()]); $this->model->addCollection($this->collectionMock); $this->assertEquals([self::INSTANCE_1 => $this->getArgument(), self::INSTANCE_2 => $this->getArgument()], $this->model->getCollection()); }
/** * {@inheritdoc} */ public function doOperation() { if (empty($this->data)) { return; } $definitionsCollection = new DefinitionsCollection(); foreach ($this->data as $path) { $definitionsCollection->addCollection($this->getDefinitionsCollection($path)); } $areaCodes = array_merge([App\Area::AREA_GLOBAL], $this->areaList->getCodes()); foreach ($areaCodes as $areaCode) { $this->configWriter->write($areaCode, $this->configReader->generateCachePerScope($definitionsCollection, $areaCode)); } }