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, []); }
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); }