예제 #1
0
 public function testGetElementAlias()
 {
     $this->_layout->addContainer('one', 'One');
     $this->_layout->addContainer('two', 'One', [], 'one', '1');
     $this->assertFalse($this->_layout->getElementAlias('one'));
     $this->assertEquals('1', $this->_layout->getElementAlias('two'));
 }
예제 #2
0
 public function testGetElementAlias()
 {
     $name = 'child_name';
     $parentId = 'parent_id';
     $alias = 'alias';
     $this->structureMock->expects($this->once())->method('getParentId')->with($this->equalTo($name))->will($this->returnValue($parentId));
     $this->structureMock->expects($this->once())->method('getChildAlias')->with($this->equalTo($parentId), $this->equalTo($name))->will($this->returnValue($alias));
     $this->assertSame($alias, $this->model->getElementAlias($name));
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function getElementAlias($name)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getElementAlias');
     if (!$pluginInfo) {
         return parent::getElementAlias($name);
     } else {
         return $this->___callPlugins('getElementAlias', func_get_args(), $pluginInfo);
     }
 }