Move DatabaseDomain to Rdbms namespace
[mediawiki.git] / tests / phpunit / includes / api / ApiParseTest.php
blobf01a670b711590bf37d816aa5012f3cb5a49ce77
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 ( ApiUsageException $ex ) {
27 $this->assertTrue( ApiTestCase::apiExceptionHasCode( $ex, 'missingtitle' ),
28 "Parse request for nonexistent page must give 'missingtitle' error: "
29 . var_export( self::getErrorFormatter()->arrayFromStatus( $ex->getStatusValue() ), true )