MediaWiki  REL1_23
ApiMainTest.php
Go to the documentation of this file.
00001 <?php
00002 
00010 class ApiMainTest extends ApiTestCase {
00011 
00018     public function testApi() {
00019         $api = new ApiMain(
00020             new FauxRequest( array( 'action' => 'help', 'format' => 'xml' ) )
00021         );
00022         $api->execute();
00023         $api->getPrinter()->setBufferResult( true );
00024         $api->printResult( false );
00025         $resp = $api->getPrinter()->getBuffer();
00026 
00027         libxml_use_internal_errors( true );
00028         $sxe = simplexml_load_string( $resp );
00029         $this->assertNotInternalType( "bool", $sxe );
00030         $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) );
00031     }
00032 
00033 }