public function testFactoryFail() { $this->setExpectedException('\\Aimeos\\MW\\Tree\\Exception'); $this->object = \Aimeos\MW\Tree\Factory::createManager('notDefined', array(), null); }
/** * Creates an object for managing the nested set. * * @param integer $siteid Site ID for the specific tree * @return \Aimeos\MW\Tree\Manager\Iface Tree manager */ protected function createTreeManager($siteid) { if (!isset($this->treeManagers[$siteid])) { $context = $this->getContext(); $config = $context->getConfig(); $dbm = $context->getDatabaseManager(); $treeConfig = array('search' => $this->searchConfig, 'dbname' => $this->getResourceName(), 'sql' => array('delete' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/delete')), 'get' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/get')), 'insert' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/insert')), 'move-left' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/move-left')), 'move-right' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/move-right')), 'search' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/search')), 'update' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/update')), 'update-parentid' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/update-parentid')), 'newid' => $this->getSqlConfig('mshop/catalog/manager/standard/newid'))); $this->treeManagers[$siteid] = \Aimeos\MW\Tree\Factory::createManager('DBNestedSet', $treeConfig, $dbm); } return $this->treeManagers[$siteid]; }
public function testFactoryFail() { $this->setExpectedException('\\Aimeos\\MW\\Tree\\Exception'); \Aimeos\MW\Tree\Factory::createManager('invalid', array(), null); }