2012-06-30 08:06:35 +00:00
|
|
|
<?php
|
2014-03-05 13:08:56 +00:00
|
|
|
|
2012-06-30 08:06:35 +00:00
|
|
|
/**
|
2014-03-05 13:08:56 +00:00
|
|
|
* Test making sure the demo export xml is valid.
|
|
|
|
|
* This is NOT a unit test
|
2012-06-30 08:06:35 +00:00
|
|
|
*
|
|
|
|
|
* @group Dump
|
2014-03-05 13:08:56 +00:00
|
|
|
* @group large
|
2012-06-30 08:06:35 +00:00
|
|
|
*/
|
|
|
|
|
class ExportDemoTest extends DumpTestCase {
|
|
|
|
|
|
2014-03-05 13:08:56 +00:00
|
|
|
public function testExportDemo() {
|
|
|
|
|
$fname = "../../docs/export-demo.xml";
|
2012-06-30 08:06:35 +00:00
|
|
|
$version = WikiExporter::schemaVersion();
|
|
|
|
|
$dom = new DomDocument();
|
|
|
|
|
$dom->load( $fname );
|
|
|
|
|
|
2012-11-03 18:37:02 +00:00
|
|
|
// Ensure, the demo is for the current version
|
2014-03-05 13:08:56 +00:00
|
|
|
$this->assertEquals(
|
|
|
|
|
$dom->documentElement->getAttribute( 'version' ),
|
|
|
|
|
$version,
|
|
|
|
|
'export-demo.xml should have the current version'
|
|
|
|
|
);
|
2012-11-03 18:37:02 +00:00
|
|
|
|
2014-03-05 13:08:56 +00:00
|
|
|
$this->assertTrue(
|
|
|
|
|
$dom->schemaValidate( "../../docs/export-" . $version . ".xsd" ),
|
|
|
|
|
"schemaValidate has found an error"
|
|
|
|
|
);
|
2012-06-30 08:06:35 +00:00
|
|
|
}
|
2014-03-05 13:08:56 +00:00
|
|
|
|
2012-06-30 08:06:35 +00:00
|
|
|
}
|