MediaWiki  1.23.12
ApiParseTest.php
Go to the documentation of this file.
1 <?php
2 
10 class ApiParseTest extends ApiTestCase {
11 
12  protected function setUp() {
13  parent::setUp();
14  $this->doLogin();
15  }
16 
17  public function testParseNonexistentPage() {
18  $somePage = mt_rand();
19 
20  try {
21  $this->doApiRequest( array(
22  'action' => 'parse',
23  'page' => $somePage ) );
24 
25  $this->fail( "API did not return an error when parsing a nonexistent page" );
26  } catch ( UsageException $ex ) {
27  $this->assertEquals( 'missingtitle', $ex->getCodeString(),
28  "Parse request for nonexistent page must give 'missingtitle' error: " . var_export( $ex->getMessageArray(), true ) );
29  }
30  }
31 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ApiParseTest\testParseNonexistentPage
testParseNonexistentPage()
Definition: ApiParseTest.php:17
UsageException\getMessageArray
getMessageArray()
Definition: ApiMain.php:1436
fail
as a message key or array as accepted by ApiBase::dieUsageMsg after processing request parameters Return false to let the request fail
Definition: hooks.txt:375
true
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition: hooks.txt:1530
UsageException
This exception will be thrown when dieUsage is called to stop module execution.
Definition: ApiMain.php:1406
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ApiTestCase
Definition: ApiTestCase.php:3
ApiParseTest
@group API @group Database @group medium
Definition: ApiParseTest.php:10
ApiParseTest\setUp
setUp()
Definition: ApiParseTest.php:12
UsageException\getCodeString
getCodeString()
Definition: ApiMain.php:1429
ApiTestCase\doLogin
doLogin( $user='sysop')
Definition: ApiTestCase.php:141
ApiTestCase\doApiRequest
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null)
Does the API request and returns the result.
Definition: ApiTestCase.php:74