summaryrefslogtreecommitdiff
path: root/tests/phpunit/docs/ExportDemoTest.php
blob: 8288cae0f2590bbc280e5d89d9cf1a30da3428be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

/**
 * Test making sure the demo export xml is valid.
 * This is NOT a unit test
 *
 * @group Dump
 * @group large
 */
class ExportDemoTest extends DumpTestCase {

	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->assertTrue(
			$dom->schemaValidate( "../../docs/export-" . $version . ".xsd" ),
			"schemaValidate has found an error"
		);
	}

}