Changeset Iec98e472 changed the behavior of action=parse&page=... when passed a page that does not exist: previously, it would return a "missingtitle" error instead of assuming an empty page. As some people had been depending on this old behavior, restore the error checking. Change-Id: I4c76ce458ceb01e233c6074cd9251879013ec143
29 lines
636 B
PHP
29 lines
636 B
PHP
<?php
|
|
|
|
/**
|
|
* @group API
|
|
* @group Database
|
|
*/
|
|
class ApiParseTest extends ApiTestCase {
|
|
|
|
protected function setUp() {
|
|
parent::setUp();
|
|
$this->doLogin();
|
|
}
|
|
|
|
function testParseNonexistentPage() {
|
|
$somePage = mt_rand();
|
|
|
|
try {
|
|
$data = $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 ) );
|
|
}
|
|
}
|
|
|
|
}
|