Merge "Add DROP INDEX support to DatabaseSqlite::replaceVars method"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiParseTest.php
1 <?php
2
3 /**
4 * @group API
5 * @group Database
6 * @group medium
7 *
8 * @covers ApiParse
9 */
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 }