test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / includes / api / ApiParseTest.php
blobb408875c2379b5769b23029af114c0343e8cf9e6
1 <?php
3 /**
4 * @group API
5 * @group Database
6 * @group medium
7 */
8 class ApiParseTest extends ApiTestCase {
10 protected function setUp() {
11 parent::setUp();
12 $this->doLogin();
15 function testParseNonexistentPage() {
16 $somePage = mt_rand();
18 try {
19 $this->doApiRequest( array(
20 'action' => 'parse',
21 'page' => $somePage ) );
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 ) );