public function testRead()
 {
     $this->_initialConfigMock->expects($this->any())->method('getData')->with(ScopeConfigInterface::SCOPE_TYPE_DEFAULT)->will($this->returnValue(['config' => ['key1' => 'default_value1', 'key2' => 'default_value2']]));
     $this->_collectionFactory->expects($this->once())->method('create')->with(['scope' => 'default'])->will($this->returnValue([new \Magento\Framework\DataObject(['path' => 'config/key1', 'value' => 'default_db_value1']), new \Magento\Framework\DataObject(['path' => 'config/key3', 'value' => 'default_db_value3'])]));
     $expectedData = ['config' => ['key1' => 'default_db_value1', 'key2' => 'default_value2', 'key3' => 'default_db_value3']];
     $this->assertEquals($expectedData, $this->_model->read());
 }
Exemple #2
0
 public function testRead()
 {
     $this->_initialConfigMock->expects($this->any())->method('getData')->with(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT)->will($this->returnValue(array('config' => array('key1' => 'default_value1', 'key2' => 'default_value2'))));
     $this->_collectionFactory->expects($this->once())->method('create')->with(array('scope' => 'default'))->will($this->returnValue(array(new \Magento\Framework\Object(array('path' => 'config/key1', 'value' => 'default_db_value1')), new \Magento\Framework\Object(array('path' => 'config/key3', 'value' => 'default_db_value3')))));
     $expectedData = array('config' => array('key1' => 'default_db_value1', 'key2' => 'default_value2', 'key3' => 'default_db_value3'));
     $this->assertEquals($expectedData, $this->_model->read());
 }