/** * @test * @return void * @covers \Magento\Theme\Model\Layout\Config::getPageLayouts * @covers \Magento\Theme\Model\Layout\Config::getPageLayout * @covers \Magento\Theme\Model\Layout\Config::getPageLayoutHandles * @covers \Magento\Theme\Model\Layout\Config::_initPageLayouts * @covers \Magento\Theme\Model\Layout\Config::__construct */ public function testGetPageLayout() { $data = ['code' => ['label' => 'Test Label', 'code' => 'testCode']]; $expectedResult = ['code' => new DataObject(['label' => __('Test Label'), 'code' => 'testCode'])]; $this->dataStorage->expects($this->once())->method('get')->with(null, null)->willReturn($data); $this->assertEquals($expectedResult, $this->_model->getPageLayouts()); $this->assertEquals($expectedResult['code'], $this->_model->getPageLayout('code')); $this->assertFalse($this->_model->getPageLayout('wrong_code')); $this->assertEquals([$expectedResult['code']['code'] => $expectedResult['code']['code']], $this->_model->getPageLayoutHandles()); }
public function testGetGroups() { $expected = []; $this->dataStorage->expects($this->once())->method('get')->with('groups')->will($this->returnValue($expected)); $this->assertEquals($expected, $this->config->getGroups()); }
public function testGetSections() { $this->sectionConfig->expects($this->once())->method('get')->with('sections')->willReturn(['data']); $this->assertEquals(['data'], $this->block->getSections()); }