MediaWiki  REL1_21
ApiParseTest.php
Go to the documentation of this file.
00001 <?php
00002 
00008 class ApiParseTest extends ApiTestCase {
00009 
00010         protected function setUp() {
00011                 parent::setUp();
00012                 $this->doLogin();
00013         }
00014 
00015         function testParseNonexistentPage() {
00016                 $somePage = mt_rand();
00017 
00018                 try {
00019                         $data = $this->doApiRequest( array(
00020                                 'action' => 'parse',
00021                                 'page' => $somePage ) );
00022 
00023                         $this->fail( "API did not return an error when parsing a nonexistent page" );
00024                 } catch ( UsageException $ex ) {
00025                         $this->assertEquals( 'missingtitle', $ex->getCodeString(),
00026                                 "Parse request for nonexistent page must give 'missingtitle' error: " . var_export( $ex->getMessageArray(), true ) );
00027                 }
00028         }
00029 
00030 }