public function testRemoveByName() { list($repo, $validator) = $this->getMocks(); $mockConfig = m::mock('Xpressengine\\Config\\ConfigEntity'); $mockConfig->name = 'board.notice'; $repo->shouldReceive('find')->once()->with('default', 'board.notice')->andReturn($mockConfig); $repo->shouldReceive('fetchParent')->with('default', 'board.notice')->andReturn([]); $repo->shouldReceive('remove')->once()->with('default', 'board.notice')->andReturnNull(); $instance = new ConfigManager($repo, $validator); $instance->removeByName('board.notice'); }
/** * Delete menu item config consisting of theme identifiers * * @param MenuItem $item menu item instance * @return void */ public function deleteMenuItemTheme(MenuItem $item) { $this->configs->removeByName($this->menuKeyString($item)); }
/** * instance 에 속한 comment 를 제거함, table 도 삭제 됨 * * @param string $instanceId instance identifier * @return void */ public function drop($instanceId) { $this->repo->dropInstance($instanceId); $this->configs->removeByName($this->getConfigKey($instanceId)); }
/** * removePageConfig * * @param string $pageId page instance id * * @return void */ protected function removePageConfig($pageId) { $configName = $this->getConfigKeyString($pageId); $this->configManager->removeByName($configName); }
/** * Process to delete * * @param $instanceId * * @return mixed */ public function deleteMenu($instanceId) { $configName = $this->getPageConfigKeyString($instanceId); $this->configManager->removeByName($configName); }
/** * deleteMenuItemTheme * * @param MenuItem $item to delete theme menu item instance * * @return void */ public function deleteMenuItemTheme(MenuItem $item) { $configKeyString = $item->getBreadCrumbsKeyString(); $this->configManager->removeByName("{$this->menuKeyword}.{$configKeyString}"); }