Replace $wgUser with RequestContext::getUser in User::getBlockedStatus
[lhc/web/wiklou.git] / tests / phpunit / includes / auth / CheckBlocksSecondaryAuthenticationProviderTest.php
index 4e44547..e8b61c5 100644 (file)
@@ -76,6 +76,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase
                $blockOptions = [
                        'address' => 'UTBlockee',
                        'user' => $user->getID(),
+                       'by' => $this->getTestSysop()->getUser()->getId(),
                        'reason' => __METHOD__,
                        'expiry' => time() + 100500,
                        'createAccount' => true,
@@ -149,6 +150,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase
                $blockOptions = [
                        'address' => '127.0.0.0/24',
                        'reason' => __METHOD__,
+                       'by' => $this->getTestSysop()->getUser()->getId(),
                        'expiry' => time() + 100500,
                        'createAccount' => true,
                ];
@@ -163,6 +165,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase
                        $user->saveSettings();
                }
                $this->setMwGlobals( [ 'wgUser' => $user ] );
+               \RequestContext::getMain()->setUser( $user );
                $newuser = \User::newFromName( 'RandomUser' );
 
                $provider = new CheckBlocksSecondaryAuthenticationProvider(