Fix DatabaseSqlite IDEA warnings
[mediawiki.git] / tests / phpunit / includes / api / ApiParseTest.php
blobb72a4f8a8b8b27879af44e699ce97dbeafecd543
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( [
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 )