Merge "DatabaseMssql: Don't duplicate body of makeList()"
[mediawiki.git] / tests / phpunit / includes / api / ApiParseTest.php
blobd038a4f52f82c42679844eae7a11fdfd08693c74
1 <?php
3 /**
4 * @group API
5 * @group Database
6 * @group medium
8 * @covers ApiParse
9 */
10 class ApiParseTest extends ApiTestCase {
12 protected function setUp() {
13 parent::setUp();
14 $this->doLogin();
17 public function testParseNonexistentPage() {
18 $somePage = mt_rand();
20 try {
21 $this->doApiRequest( array(
22 'action' => 'parse',
23 'page' => $somePage ) );
25 $this->fail( "API did not return an error when parsing a nonexistent page" );
26 } catch ( UsageException $ex ) {
27 $this->assertEquals(
28 'missingtitle',
29 $ex->getCodeString(),
30 "Parse request for nonexistent page must give 'missingtitle' error: "
31 . var_export( $ex->getMessageArray(), true )