public function testAddExtension() { $name = 'test'; $type = $this->getMock('Oro\\Component\\Layout\\BlockTypeInterface'); $extension = $this->getMock('Oro\\Component\\Layout\\Extension\\ExtensionInterface'); $layoutFactory = $this->layoutFactoryBuilder->addExtension($extension)->getLayoutFactory(); $extension->expects($this->once())->method('hasType')->with($name)->will($this->returnValue(true)); $extension->expects($this->once())->method('getType')->with($name)->will($this->returnValue($type)); $this->assertSame($type, $layoutFactory->getRegistry()->getType($name)); }
/** * Creates a layout factory builder with the default configuration. * * @return LayoutFactoryBuilderInterface */ public static function createLayoutFactoryBuilder() { $builder = new LayoutFactoryBuilder(); $builder->addExtension(new CoreExtension()); return $builder; }