Пример #1
0
 public function testGetLinks()
 {
     $blocks = [0 => 'blocks'];
     $name = 'test_name';
     $this->_context->getLayout()->expects($this->once())->method('getChildBlocks')->with($name)->will($this->returnValue($blocks));
     $this->_block->setNameInLayout($name);
     $this->assertEquals($blocks, $this->_block->getLinks());
 }
Пример #2
0
 public function testSetActive()
 {
     $link = $this->getMock('Magento\\Framework\\View\\Element\\Html\\Link', [], [], '', false);
     $link->expects($this->at(1))->method('__call')->with('setIsHighlighted', [true]);
     $link->expects($this->at(0))->method('__call')->with('getPath', [])->willReturn('test/path');
     $name = 'test_name';
     $this->context->getLayout()->expects($this->once())->method('getChildBlocks')->with($name)->willReturn([$link]);
     $this->block->setNameInLayout($name);
     $this->block->setActive('test/path');
 }