public function testProcess()
 {
     $this->_modelPoolMock->expects($this->once())->method('get')->with('Custom_Backend_Model')->will($this->returnValue($this->_backendModelMock));
     $this->_backendModelMock->expects($this->once())->method('processValue')->with('value')->will($this->returnValue('processed_value'));
     $data = ['some' => ['config' => ['path' => 'value']], 'active' => 1];
     $expectedResult = $data;
     $expectedResult['some']['config']['path'] = 'processed_value';
     $this->assertEquals($expectedResult, $this->_model->process($data));
 }
Пример #2
0
 protected function setUp()
 {
     $this->_metaDataProcessor = $this->getMock('Magento\\Framework\\App\\Config\\MetadataProcessor', [], [], '', false);
     $this->_metaDataProcessor->expects($this->any())->method('process')->will($this->returnArgument(0));
     $this->_model = new \Magento\Framework\App\Config\Data($this->_metaDataProcessor, []);
 }