Test ApiDisabled.php
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiDisabledTest.php
1 <?php
2
3 /**
4 * @group API
5 * @group medium
6 *
7 * @covers ApiDisabled
8 */
9 class ApiDisabledTest extends ApiTestCase {
10 public function testDisabled() {
11 $this->mergeMwGlobalArrayValue( 'wgAPIModules',
12 [ 'login' => 'ApiDisabled' ] );
13
14 $this->setExpectedException( ApiUsageException::class,
15 'The "login" module has been disabled.' );
16
17 $this->doApiRequest( [ 'action' => 'login' ] );
18 }
19 }