From 8f1d9e171891a5f1613ae4819dbb140261333f83 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Tue, 26 Mar 2019 19:21:35 +0100 Subject: [PATCH] Enable email settings for ApiBlockTest::testBlockWithEmailBlock Change-Id: Iea8e96c3c1d68c27ec783aa26cf5af2a3ca3869e --- tests/phpunit/includes/api/ApiBlockTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php index 7274a546ee..1c5314773a 100644 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ b/tests/phpunit/includes/api/ApiBlockTest.php @@ -175,6 +175,12 @@ class ApiBlockTest extends ApiTestCase { } public function testBlockWithEmailBlock() { + $this->setMwGlobals( [ + 'wgEnableEmail' => true, + 'wgEnableUserEmail' => true, + 'wgSysopEmailBans' => true, + ] ); + $res = $this->doBlock( [ 'noemail' => '' ] ); $dbw = wfGetDB( DB_MASTER ); @@ -187,6 +193,12 @@ class ApiBlockTest extends ApiTestCase { } public function testBlockWithProhibitedEmailBlock() { + $this->setMwGlobals( [ + 'wgEnableEmail' => true, + 'wgEnableUserEmail' => true, + 'wgSysopEmailBans' => true, + ] ); + $this->setExpectedException( ApiUsageException::class, "You don't have permission to block users from sending email through the wiki." ); -- 2.20.1