wiki.techinc.nl/tests/phpunit/includes/api/ApiParseTest.php
addshore dc18b813e8 Cleanup Api phpunit Tests
- Splits multiple classes into individual files
- Adds @covers tags
- Fixes scope

Change-Id: I7d2816d3574fa53a2aaa8e2a84b7a7ecdd245252
2013-10-24 19:17:01 +01:00

31 lines
678 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 ) );
}
}
}