Ejemplo n.º 1
0
 public function testAddTypeExtension()
 {
     $name = 'test';
     $typeExtension = $this->getMock('Oro\\Component\\Layout\\BlockTypeExtensionInterface');
     $typeExtension->expects($this->once())->method('getExtendedType')->will($this->returnValue($name));
     $blockBuilder = $this->getMock('Oro\\Component\\Layout\\BlockBuilderInterface');
     $layoutFactory = $this->layoutFactoryBuilder->addTypeExtension($typeExtension)->getLayoutFactory();
     $typeExtension->expects($this->once())->method('buildBlock')->with($this->identicalTo($blockBuilder), []);
     $layoutFactory->getRegistry()->buildBlock($name, $blockBuilder, []);
 }
Ejemplo n.º 2
0
 public function testAddTypeExtension()
 {
     $name = 'test';
     /** @var BlockTypeExtensionInterface|\PHPUnit_Framework_MockObject_MockObject $typeExtension */
     $typeExtension = $this->getMock('Oro\\Component\\Layout\\BlockTypeExtensionInterface');
     $typeExtension->expects($this->once())->method('getExtendedType')->will($this->returnValue($name));
     /** @var BlockBuilderInterface $blockBuilder */
     $blockBuilder = $this->getMock('Oro\\Component\\Layout\\BlockBuilderInterface');
     $layoutFactory = $this->layoutFactoryBuilder->addTypeExtension($typeExtension)->getLayoutFactory();
     $typeExtension->expects($this->once())->method('buildBlock')->with($this->identicalTo($blockBuilder), []);
     $options = [];
     $layoutFactory->getRegistry()->buildBlock($name, $blockBuilder, $options);
 }