Enable email settings for ApiBlockTest::testBlockWithEmailBlock
authorUmherirrender <umherirrender_de.wp@web.de>
Tue, 26 Mar 2019 18:21:35 +0000 (19:21 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 11 May 2019 10:34:13 +0000 (10:34 +0000)
Change-Id: Iea8e96c3c1d68c27ec783aa26cf5af2a3ca3869e

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." );