wiki.techinc.nl/tests/phpunit/includes/api/ApiParseTest.php
Siebrand Mazeland 80a8a8e85c Pass phpcs-strict on some test files (5/x)
Change-Id: I690645cd8a9b1165dcc8271b201c695ea9391226
2014-04-24 18:51:45 +02:00

35 lines
694 B
PHP

<?php
/**
* @group API
* @group Database
* @group medium
*
* @covers ApiParse
*/
class ApiParseTest extends ApiTestCase {
protected function setUp() {
parent::setUp();
$this->doLogin();
}
public function testParseNonexistentPage() {
$somePage = mt_rand();
try {
$this->doApiRequest( array(
'action' => 'parse',
'page' => $somePage ) );
$this->fail( "API did not return an error when parsing a nonexistent page" );
} catch ( UsageException $ex ) {
$this->assertEquals(
'missingtitle',
$ex->getCodeString(),
"Parse request for nonexistent page must give 'missingtitle' error: "
. var_export( $ex->getMessageArray(), true )
);
}
}
}