24 $pageTitle =
'UTPage';
31 $title = Title::newFromText( $pageTitle );
34 $exporter->setOutputSink( $sink );
35 $exporter->openStream();
36 $exporter->pageByTitle( $title );
37 $exporter->closeStream();
40 $xmlObject = simplexml_load_string( $sink );
45 $xmlNamespaces = (
array)$xmlObject->siteinfo->namespaces->namespace;
46 $xmlNamespaces = str_replace(
' ',
'_', $xmlNamespaces );
47 unset( $xmlNamespaces[
'@attributes' ] );
48 foreach ( $xmlNamespaces as &$namespaceObject ) {
49 if ( is_object( $namespaceObject ) ) {
50 $namespaceObject =
'';
55 $actualNamespaces = array_values( $actualNamespaces );
56 $this->assertEquals( $actualNamespaces, $xmlNamespaces );
59 $xmlTitle = (
array)$xmlObject->page->title;
60 $this->assertEquals( $pageTitle, $xmlTitle[0] );
63 $text = (
array)$xmlObject->page->revision->text;
64 $this->assertNotEquals(
'', $text[0] );