/** * Test get page layouts config * * @return void */ public function testGetPageLayoutsConfig() { $files1 = ['content layouts_1.xml', 'content layouts_2.xml']; $files2 = ['content layouts_3.xml', 'content layouts_4.xml']; $theme1 = $this->getMockBuilder('Magento\\Theme\\Model\\Theme\\Data')->disableOriginalConstructor()->getMock(); $theme2 = $this->getMockBuilder('Magento\\Theme\\Model\\Theme\\Data')->disableOriginalConstructor()->getMock(); $this->themeCollection->expects($this->any())->method('loadRegisteredThemes')->willReturn([$theme1, $theme2]); $this->fileCollector->expects($this->exactly(2))->method('getFilesContent')->willReturnMap([[$theme1, 'layouts.xml', $files1], [$theme2, 'layouts.xml', $files2]]); $config = $this->getMockBuilder('Magento\\Framework\\View\\PageLayout\\Config')->disableOriginalConstructor()->getMock(); $this->configFactory->expects($this->once())->method('create')->with(['configFiles' => array_merge($files1, $files2)])->willReturn($config); $this->assertSame($config, $this->builder->getPageLayoutsConfig()); }
/** * @return \Magento\Framework\View\PageLayout\Config */ public function getPageLayoutsConfig() { return $this->configFactory->create(['configFiles' => $this->getConfigFiles()]); }