Ejemplo n.º 1
0
 /**
  * Test that the API will accept a FauxRequest and execute. The help action
  * (default) throws a UsageException. Just validate we're getting proper XML
  *
  * @expectedException UsageException
  */
 function testApi()
 {
     $api = new ApiMain(new FauxRequest(array('action' => 'help', 'format' => 'xml')));
     $api->execute();
     $api->getPrinter()->setBufferResult(true);
     $api->printResult(false);
     $resp = $api->getPrinter()->getBuffer();
     libxml_use_internal_errors(true);
     $sxe = simplexml_load_string($resp);
     $this->assertNotInternalType("bool", $sxe);
     $this->assertThat($sxe, $this->isInstanceOf("SimpleXMLElement"));
 }