Merge "add htmlform-no and htmlform-yes messages for generic yes-no questions"
[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 class ApiParseTest extends ApiTestCase {
9
10 protected function setUp() {
11 parent::setUp();
12 $this->doLogin();
13 }
14
15 function testParseNonexistentPage() {
16 $somePage = mt_rand();
17
18 try {
19 $data = $this->doApiRequest( array(
20 'action' => 'parse',
21 'page' => $somePage ) );
22
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 ) );
27 }
28 }
29
30 }