Debian Codegraph @

tests/phpunit/docs/ExportDemoTest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Tests\Maintenance;
4
5 use DOMDocument;
6 use WikiExporter;
7
8 /**
9 * Test making sure the demo export xml is valid.
10 * This is NOT a unit test
11 *
12 * @group Dump
13 * @group large
14 * @coversNothing
15 */
16 class ExportDemoTest extends DumpTestCase {
17
18 public function testExportDemo() {
19 $fname = __DIR__ . "/../../../docs/export-demo.xml";
20 $version = WikiExporter::schemaVersion();
21 $dom = new DomDocument();
22 $dom->load( $fname );
23
24 // Ensure, the demo is for the current version
25 $this->assertEquals(
26 $version,
27 $dom->documentElement->getAttribute( 'version' ),
28 'export-demo.xml should have the current version'
29 );
30
31 $this->assertTrue(
32 $dom->schemaValidate( __DIR__ . "/../../../docs/export-" . $version . ".xsd" ),
33 "schemaValidate has found an error"
34 );
35 }
36
37 }