7 class ApiParseTest
extends ApiTestCase
{
9 protected function setUp() {
14 function testParseNonexistentPage() {
15 $somePage = mt_rand();
18 $data = $this->doApiRequest( array(
20 'page' => $somePage ) );
22 $this->fail( "API did not return an error when parsing a nonexistent page" );
23 } catch(UsageException
$ex){
24 $this->assertEquals( 'missingtitle', $ex->getCodeString(),
25 "Parse request for nonexistent page must give 'missingtitle' error: " . var_export( $ex->getMessageArray(), true ) );