parser = new InfoParser(); } /** * @dataProvider providesInfoXml */ public function testParsingValidXml($expectedJson, $xmlFile) { $expectedData = null; if (!is_null($expectedJson)) { $expectedData = json_decode(file_get_contents(OC::$SERVERROOT . "/tests/data/app/$expectedJson"), true); } $data = $this->parser->parse(OC::$SERVERROOT. "/tests/data/app/$xmlFile"); $this->assertEquals($expectedData, $data); } function providesInfoXml() { return array( array('expected-info.json', 'valid-info.xml'), array(null, 'invalid-info.xml'), ); } }