From 05d01e51ca993d28b37bf54170e7b62477c121aa Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Tue, 20 Mar 2018 18:01:07 +0200 Subject: [PATCH] Test ApiDisabled.php Locally this reports that everything is covered, although the get*() functions are not registering at all (white backgrounds). Change-Id: I73fabfb33b329dc3416368fda52d35f7ee6a4a18 --- .../phpunit/includes/api/ApiDisabledTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/phpunit/includes/api/ApiDisabledTest.php 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' ] ); + } +} -- 2.20.1