/** * @covers Mage_Core_Controller_Varien_Router_Standard::getControllerFileName * @covers Mage_Core_Controller_Varien_Router_Standard::validateControllerFileName */ public function testGetControllerFileName() { $file = $this->_model->getControllerFileName('Mage_Core', 'index'); $this->assertStringEndsWith('IndexController.php', $file); $this->assertTrue($this->_model->validateControllerFileName($file)); $this->assertFalse($this->_model->validateControllerFileName('')); }
public function getControllerInformation($module_name) { if (!$this->_controllerInformation) { $router_object = new Mage_Core_Controller_Varien_Router_Standard(); $this->_controllerInformation = array(); $this->_controllerInformation['class_file'] = $router_object->getControllerFileName($module_name, $this->getUrlControllerName()); $this->_controllerInformation['class_name'] = $router_object->getControllerClassName($module_name, $this->getUrlControllerName()); } return $this->_controllerInformation; }
/** * Retrieve the controller class filename * This method allows Addon WP modules to use their own controller * * @param string $realModule * @param string $controller * @return string */ public function getControllerFileName($realModule, $controller) { if (substr_count($realModule, '_') > 1) { return Mage::getModuleDir('controllers', $realModule) . DS . uc_words($controller, DS) . 'Controller.php'; } return parent::getControllerFileName($realModule, $controller); }