X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=inline;f=tests%2Fphpunit%2Fdocs%2FExportDemoTest.php;h=ec806aeff4279391a99b4b8470d18ddfcd0df66d;hb=4905504faded8f85a9b3d68b27da5c9e2f11bd06;hp=211de261e6fea235f28d8932d7bb81d4cf733199;hpb=2b69c9525bcf75ad0ea203d4256cfef9e3d6fd40;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/docs/ExportDemoTest.php b/tests/phpunit/docs/ExportDemoTest.php index 211de261e6..ec806aeff4 100644 --- a/tests/phpunit/docs/ExportDemoTest.php +++ b/tests/phpunit/docs/ExportDemoTest.php @@ -1,39 +1,32 @@ validateXmlFileAgainstXsd( "../../docs/export-demo.xml" ); - } - - /** - * Validates a xml file against the xsd. - * - * The validation is slow, because php has to read the xsd on each call. - * - * @param $fname string: name of file to validate - */ - protected function validateXmlFileAgainstXsd( $fname ) { + public function testExportDemo() { + $fname = "../../docs/export-demo.xml"; $version = WikiExporter::schemaVersion(); - $dom = new DomDocument(); $dom->load( $fname ); // Ensure, the demo is for the current version - $this->assertEquals( $dom->documentElement->getAttribute( 'version' ), $version, 'export-demo.xml should have the current version' ); + $this->assertEquals( + $dom->documentElement->getAttribute( 'version' ), + $version, + 'export-demo.xml should have the current version' + ); - try { - $this->assertTrue( $dom->schemaValidate( "../../docs/export-" . $version . ".xsd" ), - "schemaValidate has found an error" ); - } catch( Exception $e ) { - $this->fail( "xml not valid against xsd: " . $e->getMessage() ); - } + $this->assertTrue( + $dom->schemaValidate( "../../docs/export-" . $version . ".xsd" ), + "schemaValidate has found an error" + ); } + }