Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / api / ApiMainTest.php
blob4ed5aa97210c2efa35cca9678fe7649b5be0dbdf
1 <?php
3 /**
4 * @group API
5 * @group Database
6 * @group medium
8 * @covers ApiMain
9 */
10 class ApiMainTest extends ApiTestCase {
12 /**
13 * Test that the API will accept a FauxRequest and execute. The help action
14 * (default) throws a UsageException. Just validate we're getting proper XML
16 * @expectedException UsageException
18 public function testApi() {
19 $api = new ApiMain(
20 new FauxRequest( array( 'action' => 'help', 'format' => 'xml' ) )
22 $api->execute();
23 $api->getPrinter()->setBufferResult( true );
24 $api->printResult( false );
25 $resp = $api->getPrinter()->getBuffer();
27 libxml_use_internal_errors( true );
28 $sxe = simplexml_load_string( $resp );
29 $this->assertNotInternalType( "bool", $sxe );
30 $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) );