Exemplo n.º 1
0
 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'));
 }
Exemplo n.º 2
0
 public function testSetGetActionName()
 {
     $this->_model->setActionName('view');
     $this->assertEquals('view', $this->_model->getActionName());
     $this->markTestIncomplete('setActionName() logic is unclear.');
 }
Exemplo n.º 3
0
 /**
  * Translates the action part before delivered to frontend
  *
  * @return false|mixed|null|string
  */
 public function getActionName()
 {
     if (!$this->translationEnabled()) {
         return parent::getActionName();
     }
     return $this->getTranslationModel()->translateActionToFront(parent::getActionName());
 }