From: Aryeh Gregor Date: Tue, 20 Mar 2018 16:01:07 +0000 (+0200) Subject: Test ApiDisabled.php X-Git-Tag: 1.31.0-rc.0~326^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=05d01e51ca993d28b37bf54170e7b62477c121aa Test ApiDisabled.php Locally this reports that everything is covered, although the get*() functions are not registering at all (white backgrounds). Change-Id: I73fabfb33b329dc3416368fda52d35f7ee6a4a18 --- diff --git a/tests/phpunit/includes/api/ApiDisabledTest.php b/tests/phpunit/includes/api/ApiDisabledTest.php new file mode 100644 index 0000000000..cfdd57b89a --- /dev/null +++ b/tests/phpunit/includes/api/ApiDisabledTest.php @@ -0,0 +1,19 @@ +mergeMwGlobalArrayValue( 'wgAPIModules', + [ 'login' => 'ApiDisabled' ] ); + + $this->setExpectedException( ApiUsageException::class, + 'The "login" module has been disabled.' ); + + $this->doApiRequest( [ 'action' => 'login' ] ); + } +}