MediaWiki REL1_31
ApiDisabledTest.php
Go to the documentation of this file.
1<?php
2
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}
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
mergeMwGlobalArrayValue( $name, $values)
Merges the given values into a MW global array variable.