Merge "Enable email settings for ApiBlockTest::testBlockWithEmailBlock"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 20 May 2019 05:14:48 +0000 (05:14 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 20 May 2019 05:14:48 +0000 (05:14 +0000)
tests/phpunit/includes/api/ApiBlockTest.php

index 7274a54..1c53147 100644 (file)
@@ -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." );