10 class ApiMainTest
extends ApiTestCase
{
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() {
20 new FauxRequest( array( 'action' => 'help', 'format' => 'xml' ) )
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" ) );