10 class ApiParseTest
extends ApiTestCase
{
12 protected function setUp() {
17 public function testParseNonexistentPage() {
18 $somePage = mt_rand();
21 $this->doApiRequest( [
23 'page' => $somePage ] );
25 $this->fail( "API did not return an error when parsing a nonexistent page" );
26 } catch ( ApiUsageException
$ex ) {
27 $this->assertTrue( ApiTestCase
::apiExceptionHasCode( $ex, 'missingtitle' ),
28 "Parse request for nonexistent page must give 'missingtitle' error: "
29 . var_export( self
::getErrorFormatter()->arrayFromStatus( $ex->getStatusValue() ), true )