public function testMatch() { if (!Magento_Test_Bootstrap::canTestHeaders()) { $this->markTestSkipped('Can\'t test get match without sending headers'); } $request = new Magento_Test_Request(); $this->assertFalse($this->_model->match($request)); $this->_model->collectRoutes('frontend', 'standard'); $this->assertTrue($this->_model->match($request)); $request->setRequestUri('core/index/index'); $this->assertTrue($this->_model->match($request)); $request->setPathInfo('not_exists/not_exists/not_exists')->setModuleName('not_exists')->setControllerName('not_exists')->setActionName('not_exists'); $this->assertFalse($this->_model->match($request)); }
/** * Emulate custom admin url * * @param string $configArea * @param bool $useRouterName */ public function collectRoutes($configArea, $useRouterName) { if ((string) Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_PATH)) { $customUrl = (string) Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH); $xmlPath = Mage_Adminhtml_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME; if ((string) Mage::getConfig()->getNode($xmlPath) != $customUrl) { Mage::getConfig()->setNode($xmlPath, $customUrl, true); } } parent::collectRoutes($configArea, $useRouterName); }
public function collectRoutes($configArea, $useRouterName) { // Collect all routes from standard router parent::collectRoutes($configArea, 'standard'); }
/** * Collect routes * * @param $configArea * @param $useRouterName */ public function collectRoutes($configArea, $useRouterName) { parent::collectRoutes($configArea, 'standard'); }
public function init() { Mage::dispatchEvent('controller_front_init_before', array('front' => $this)); Varien_Profiler::start('ctrl/init'); Mage::getModel('core/url_rewrite')->rewrite(); // init admin modules router $admin = new Mage_Core_Controller_Varien_Router_Admin(); $admin->collectRoutes('admin', 'admin'); $this->addRouter('admin', $admin); // init standard frontend modules router $standard = new Mage_Core_Controller_Varien_Router_Standard(); $standard->collectRoutes('frontend', 'standard'); $this->addRouter('standard', $standard); // init custom routers Mage::dispatchEvent('controller_front_init_routers', array('front' => $this)); // init default router (articles and 404) $default = new Mage_Core_Controller_Varien_Router_Default(); $this->addRouter('default', $default); Varien_Profiler::stop('ctrl/init'); return $this; }