From 7c78f7624f035e4e8307e8e282367f046abf3524 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 5 Mar 2014 14:08:56 +0100 Subject: [PATCH] Clean up ExportDemoTest Change-Id: I28574b6c83cbd1128ad97b4868cc365336a7d4b8 --- tests/phpunit/docs/ExportDemoTest.php | 40 +++++++++++---------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/tests/phpunit/docs/ExportDemoTest.php b/tests/phpunit/docs/ExportDemoTest.php index b09487a6e8..8288cae0f2 100644 --- a/tests/phpunit/docs/ExportDemoTest.php +++ b/tests/phpunit/docs/ExportDemoTest.php @@ -1,39 +1,31 @@ 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" + ); } + } -- 2.20.1