示例#1
0
 /**
  * @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());
 }
示例#2
0
 /**
  * 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;
 }
示例#3
0
 /**
  * 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;
 }
示例#4
0
 /**
  * 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;
 }
示例#5
0
文件: Config.php 项目: aiesh/magento2
 /**
  * Get list of settings for showing totals in PDF
  *
  * @return array
  */
 public function getTotals()
 {
     return $this->_dataStorage->get('totals', array());
 }
示例#6
0
 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');
 }
示例#9
0
 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());
 }