3 * Test for the demo xml
7 class ExportDemoTest
extends DumpTestCase
{
12 function testExportDemo() {
13 $this->validateXmlFileAgainstXsd( "../../docs/export-demo.xml" );
17 * Validates a xml file against the xsd.
19 * The validation is slow, because php has to read the xsd on each call.
21 * @param $fname string: name of file to validate
23 protected function validateXmlFileAgainstXsd( $fname ) {
24 $version = WikiExporter
::schemaVersion();
26 $dom = new DomDocument();
29 // Ensure, the demo is for the current version
30 $this->assertEquals( $dom->documentElement
->getAttribute( 'version' ), $version, 'export-demo.xml should have the current version' );
33 $this->assertTrue( $dom->schemaValidate( "../../docs/export-" . $version . ".xsd" ),
34 "schemaValidate has found an error" );
35 } catch ( Exception
$e ) {
36 $this->fail( "xml not valid against xsd: " . $e->getMessage() );