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