Mwalker has submitted this change and it was merged.

Change subject: Clean up ExportDemoTest
......................................................................


Clean up ExportDemoTest

Change-Id: I28574b6c83cbd1128ad97b4868cc365336a7d4b8
---
M tests/phpunit/docs/ExportDemoTest.php
1 file changed, 16 insertions(+), 24 deletions(-)

Approvals:
  Mwalker: Looks good to me, approved



diff --git a/tests/phpunit/docs/ExportDemoTest.php 
b/tests/phpunit/docs/ExportDemoTest.php
index b09487a..8288cae 100644
--- a/tests/phpunit/docs/ExportDemoTest.php
+++ b/tests/phpunit/docs/ExportDemoTest.php
@@ -1,39 +1,31 @@
 <?php
+
 /**
- * Test for the demo xml
+ * Test making sure the demo export xml is valid.
+ * This is NOT a unit test
  *
  * @group Dump
+ * @group large
  */
 class ExportDemoTest extends DumpTestCase {
 
-       /**
-        * @group large
-        */
-       function testExportDemo() {
-               $this->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"
+               );
        }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/116955
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I28574b6c83cbd1128ad97b4868cc365336a7d4b8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: Mwalker <mwal...@wikimedia.org>
Gerrit-Reviewer: Waldir <wal...@email.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to