wiki.techinc.nl/tests/phpunit/includes/api/ApiDisabledTest.php
Aryeh Gregor 05d01e51ca Test ApiDisabled.php
Locally this reports that everything is covered, although the get*()
functions are not registering at all (white backgrounds).

Change-Id: I73fabfb33b329dc3416368fda52d35f7ee6a4a18
2018-03-20 18:01:07 +02:00

19 lines
395 B
PHP

<?php
/**
* @group API
* @group medium
*
* @covers ApiDisabled
*/
class ApiDisabledTest extends ApiTestCase {
public function testDisabled() {
$this->mergeMwGlobalArrayValue( 'wgAPIModules',
[ 'login' => 'ApiDisabled' ] );
$this->setExpectedException( ApiUsageException::class,
'The "login" module has been disabled.' );
$this->doApiRequest( [ 'action' => 'login' ] );
}
}