/** * @dataProvider readerDataProvider */ public function testReadValidConfig($files, $expectedFile) { $this->_fileResolverMock->expects($this->once())->method('get')->with('mview.xml', 'scope')->will($this->returnValue($files)); $constraint = function (\DOMDocument $actual) use($expectedFile) { try { $expected = file_get_contents(__DIR__ . '/../_files/' . $expectedFile); \PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($expected, $actual->saveXML()); return true; } catch (\PHPUnit_Framework_AssertionFailedError $e) { return false; } }; $expectedResult = new \stdClass(); $this->_converter->expects($this->once())->method('convert')->with($this->callback($constraint))->will($this->returnValue($expectedResult)); $this->assertSame($expectedResult, $this->_model->read('scope')); }
/** * Test for get method with default scope * * @dataProvider providerGet * @param string $filename * @param array $fileList */ public function testGetDefault($filename, $fileList) { $scope = 'some_scope'; $this->moduleReader->expects($this->once())->method('getConfigurationFiles')->with($scope . '/' . $filename)->will($this->returnValue($fileList)); $this->assertEquals($fileList, $this->model->get($filename, $scope)); }
/** * {@inheritdoc} */ public function get($filename, $scope) { return $this->merge(parent::get($filename, $scope), $this->getIntegrationTestConfigFiles()); }