wiki.techinc.nl/tests/phpunit/includes/api/ApiParseTest.php
Siebrand Mazeland 483e29277f Remove unused local variables in tests
Change-Id: I71318eb7d8c00bfc1ce6d2fc636b498f7a695f42
2013-04-26 09:48:46 +02:00

30 lines
649 B
PHP

<?php
/**
* @group API
* @group Database
* @group medium
*/
class ApiParseTest extends ApiTestCase {
protected function setUp() {
parent::setUp();
$this->doLogin();
}
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 ) );
}
}
}