Exemple #1
0
 /**
  * @covers \Magento\Framework\ObjectManager\Config\Reader\Dom::_createConfigMerger()
  */
 public function testRead()
 {
     $fileList = ['first content item'];
     $this->fileResolverMock->expects($this->once())->method('get')->will($this->returnValue($fileList));
     $this->converterMock->expects($this->once())->method('convert')->with('reader dom result');
     $this->model->read();
 }
 /**
  * @param $area
  * @dataProvider loadDataProvider
  */
 public function testLoad($area)
 {
     $configData = ['some' => 'config', 'data' => 'value'];
     $this->_cacheMock->expects($this->once())->method('load')->with($area . '::DiConfig')->will($this->returnValue(false));
     $this->_readerMock->expects($this->once())->method('read')->with($area)->will($this->returnValue($configData));
     $this->assertEquals($configData, $this->_model->load($area));
 }
Exemple #3
0
 /**
  * Load modules DI configuration
  *
  * @param string $area
  * @return array
  */
 public function load($area)
 {
     $cacheId = $area . '::DiConfig';
     $data = $this->_cache->load($cacheId);
     if (!$data) {
         $data = $this->_reader->read($area);
         $this->_cache->save(serialize($data), $cacheId);
     } else {
         $data = unserialize($data);
     }
     return $data;
 }