/** * @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()); }
/** * Initialize page layouts list * * @return \Magento\Theme\Model\Layout\Config */ protected function _initPageLayouts() { if ($this->_pageLayouts === null) { $this->_pageLayouts = []; foreach ($this->_dataStorage->get(null) as $layoutCode => $layoutConfig) { $layoutConfig['label'] = __($layoutConfig['label']); $this->_pageLayouts[$layoutCode] = new \Magento\Framework\Object($layoutConfig); } } return $this; }
/** * Initialize page types list * * @return $this */ protected function _initPageTypes() { if ($this->_pageTypes === null) { $this->_pageTypes = []; foreach ($this->_dataStorage->get(null) as $pageTypeId => $pageTypeConfig) { $pageTypeConfig['label'] = (string) new \Magento\Framework\Phrase($pageTypeConfig['label']); $this->_pageTypes[$pageTypeId] = new \Magento\Framework\DataObject($pageTypeConfig); } } return $this; }
/** * Initialize page types list * * @return $this */ protected function _initPageTypes() { if ($this->_pageTypes === null) { $this->_pageTypes = array(); foreach ($this->_dataStorage->get(null) as $pageTypeId => $pageTypeConfig) { $pageTypeConfig['label'] = __($pageTypeConfig['label']); $this->_pageTypes[$pageTypeId] = new \Magento\Framework\Object($pageTypeConfig); } } return $this; }
/** * Get list of settings for showing totals in PDF * * @return array */ public function getTotals() { return $this->_dataStorage->get('totals', array()); }
public function testGetGroups() { $expected = []; $this->dataStorage->expects($this->once())->method('get')->with('groups')->will($this->returnValue($expected)); $this->assertEquals($expected, $this->config->getGroups()); }
/** * Get payment groups * * @return array * @api */ public function getGroups() { return $this->_dataStorage->get('groups'); }
/** * Get list of sections for invalidation * * @return array */ public function getSections() { return $this->sectionConfig->get('sections'); }
public function getAdyenCcTypes() { return $this->_dataStorage->get('adyen_credit_cards'); }
public function testGetSections() { $this->sectionConfig->expects($this->once())->method('get')->with('sections')->willReturn(['data']); $this->assertEquals(['data'], $this->block->getSections()); }