Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403397 )

Change subject: Remove unused method parameters from TestBagOStuff
......................................................................

Remove unused method parameters from TestBagOStuff

This is a test mock exclusively used in tests. All code I'm removing here
is unused and neither needed nor covered by any test.

Change-Id: Ifd010c49973460f6fbb2cd83f8fd63488f5fd291
---
M tests/phpunit/includes/session/TestBagOStuff.php
1 file changed, 11 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/403397/1

diff --git a/tests/phpunit/includes/session/TestBagOStuff.php 
b/tests/phpunit/includes/session/TestBagOStuff.php
index fd02a2e..f9e30f0 100644
--- a/tests/phpunit/includes/session/TestBagOStuff.php
+++ b/tests/phpunit/includes/session/TestBagOStuff.php
@@ -14,53 +14,44 @@
        /**
         * @param string $id Session ID
         * @param array $data Session data
-        * @param int $expiry Expiry
-        * @param User $user User for metadata
         */
-       public function setSessionData( $id, array $data, $expiry = 0, User 
$user = null ) {
-               $this->setSession( $id, [ 'data' => $data ], $expiry, $user );
+       public function setSessionData( $id, array $data ) {
+               $this->setSession( $id, [ 'data' => $data ] );
        }
 
        /**
         * @param string $id Session ID
         * @param array $metadata Session metadata
-        * @param int $expiry Expiry
         */
-       public function setSessionMeta( $id, array $metadata, $expiry = 0 ) {
-               $this->setSession( $id, [ 'metadata' => $metadata ], $expiry );
+       public function setSessionMeta( $id, array $metadata ) {
+               $this->setSession( $id, [ 'metadata' => $metadata ] );
        }
 
        /**
         * @param string $id Session ID
         * @param array $blob Session metadata and data
-        * @param int $expiry Expiry
-        * @param User $user User for metadata
         */
-       public function setSession( $id, array $blob, $expiry = 0, User $user = 
null ) {
+       public function setSession( $id, array $blob ) {
                $blob += [
                        'data' => [],
                        'metadata' => [],
                ];
                $blob['metadata'] += [
-                       'userId' => $user ? $user->getId() : 0,
-                       'userName' => $user ? $user->getName() : null,
-                       'userToken' => $user ? $user->getToken( true ) : null,
+                       'userId' => 0,
+                       'userName' => null,
+                       'userToken' => null,
                        'provider' => 'DummySessionProvider',
                ];
 
-               $this->setRawSession( $id, $blob, $expiry, $user );
+               $this->setRawSession( $id, $blob );
        }
 
        /**
         * @param string $id Session ID
         * @param array|mixed $blob Session metadata and data
-        * @param int $expiry Expiry
         */
-       public function setRawSession( $id, $blob, $expiry = 0 ) {
-               if ( $expiry <= 0 ) {
-                       $expiry = \RequestContext::getMain()->getConfig()->get( 
'ObjectCacheSessionExpiry' );
-               }
-
+       public function setRawSession( $id, $blob ) {
+               $expiry = \RequestContext::getMain()->getConfig()->get( 
'ObjectCacheSessionExpiry' );
                $this->set( $this->makeKey( 'MWSession', $id ), $blob, $expiry 
);
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/403397
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd010c49973460f6fbb2cd83f8fd63488f5fd291
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to