public function testSetRoutePathWhenRouteParamsExists() { $this->assertNull($this->_model->getControllerName()); $this->assertNull($this->_model->getActionName()); $this->_model->setRoutePath('m/c/a/p1/v1/p2/v2'); $this->assertNotNull($this->_model->getControllerName()); $this->assertNotNull($this->_model->getActionName()); $this->assertNotEmpty($this->_model->getRouteParams()); $this->assertArrayHasKey('p1', $this->_model->getRouteParams()); $this->assertArrayHasKey('p2', $this->_model->getRouteParams()); $this->assertEquals('v1', $this->_model->getRouteParam('p1')); $this->assertEquals('v2', $this->_model->getRouteParam('p2')); }
/** * Translates the controller part before delivered to frontend * * @return false|mixed|null|string */ public function getControllerName() { if (!$this->translationEnabled()) { return parent::getControllerName(); } return $this->getTranslationModel()->translateControllerToFront(parent::getControllerName()); }
public function testSetGetControllerName() { $this->_model->setControllerName('product'); $this->assertEquals('product', $this->_model->getControllerName()); $this->markTestIncomplete('setControllerName() logic is unclear.'); }