Remove unnecessary variable from UserTest
authorThalia <thalia.e.chan@googlemail.com>
Tue, 26 Feb 2019 22:15:31 +0000 (22:15 +0000)
committerThalia <thalia.e.chan@googlemail.com>
Tue, 26 Feb 2019 22:15:31 +0000 (22:15 +0000)
Change-Id: I2aaae36cc3102b309aa8f5ab05f512c4fbf9810c

tests/phpunit/includes/user/UserTest.php

index 863ff50..64bdf31 100644 (file)
@@ -599,7 +599,6 @@ class UserTest extends MediaWikiTestCase {
                ] );
 
                // 1. Log in a test user, and block them.
-               $userBlocker = $this->getTestSysop()->getUser();
                $user1tmp = $this->getTestUser()->getUser();
                $request1 = new FauxRequest();
                $request1->getSession()->setUser( $user1tmp );
@@ -610,7 +609,6 @@ class UserTest extends MediaWikiTestCase {
                ] );
                $block->setBlocker( $this->getTestSysop()->getUser() );
                $block->setTarget( $user1tmp );
-               $block->setBlocker( $userBlocker );
                $res = $block->insert();
                $this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
                $user1 = User::newFromSession( $request1 );
@@ -682,14 +680,12 @@ class UserTest extends MediaWikiTestCase {
                ] );
 
                // 1. Log in a test user, and block them.
-               $userBlocker = $this->getTestSysop()->getUser();
                $testUser = $this->getTestUser()->getUser();
                $request1 = new FauxRequest();
                $request1->getSession()->setUser( $testUser );
                $block = new Block( [ 'enableAutoblock' => true ] );
                $block->setBlocker( $this->getTestSysop()->getUser() );
                $block->setTarget( $testUser );
-               $block->setBlocker( $userBlocker );
                $res = $block->insert();
                $this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
                $user = User::newFromSession( $request1 );
@@ -729,14 +725,12 @@ class UserTest extends MediaWikiTestCase {
                ] );
 
                // 1. Log in a test user, and block them indefinitely.
-               $userBlocker = $this->getTestSysop()->getUser();
                $user1Tmp = $this->getTestUser()->getUser();
                $request1 = new FauxRequest();
                $request1->getSession()->setUser( $user1Tmp );
                $block = new Block( [ 'enableAutoblock' => true, 'expiry' => 'infinity' ] );
                $block->setBlocker( $this->getTestSysop()->getUser() );
                $block->setTarget( $user1Tmp );
-               $block->setBlocker( $userBlocker );
                $res = $block->insert();
                $this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
                $user1 = User::newFromSession( $request1 );
@@ -829,14 +823,12 @@ class UserTest extends MediaWikiTestCase {
                ] );
 
                // 1. Log in a blocked test user.
-               $userBlocker = $this->getTestSysop()->getUser();
                $user1tmp = $this->getTestUser()->getUser();
                $request1 = new FauxRequest();
                $request1->getSession()->setUser( $user1tmp );
                $block = new Block( [ 'enableAutoblock' => true ] );
                $block->setBlocker( $this->getTestSysop()->getUser() );
                $block->setTarget( $user1tmp );
-               $block->setBlocker( $userBlocker );
                $res = $block->insert();
                $this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
                $user1 = User::newFromSession( $request1 );
@@ -876,14 +868,12 @@ class UserTest extends MediaWikiTestCase {
                ] );
 
                // 1. Log in a blocked test user.
-               $userBlocker = $this->getTestSysop()->getUser();
                $user1tmp = $this->getTestUser()->getUser();
                $request1 = new FauxRequest();
                $request1->getSession()->setUser( $user1tmp );
                $block = new Block( [ 'enableAutoblock' => true ] );
                $block->setBlocker( $this->getTestSysop()->getUser() );
                $block->setTarget( $user1tmp );
-               $block->setBlocker( $userBlocker );
                $res = $block->insert();
                $this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
                $user1 = User::newFromSession( $request1 );