summaryrefslogtreecommitdiff
path: root/www/wiki/tests/phpunit/includes/api/ApiDisabledTest.php
blob: cfdd57b89a29ad5a07c6604f175368e772f093ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?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' ] );
	}
}