Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/180323

Change subject: Don't cache the TestUser instance in BotEditTest
......................................................................

Don't cache the TestUser instance in BotEditTest

This broke due to Icf5cb4d4a2c

Bug: T78712
Change-Id: I7aefc6527a38ce72bb58cf5025d8428dddf1c265
---
M repo/tests/phpunit/includes/api/BotEditTest.php
1 file changed, 10 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/23/180323/1

diff --git a/repo/tests/phpunit/includes/api/BotEditTest.php 
b/repo/tests/phpunit/includes/api/BotEditTest.php
index 6115426..0029340 100644
--- a/repo/tests/phpunit/includes/api/BotEditTest.php
+++ b/repo/tests/phpunit/includes/api/BotEditTest.php
@@ -33,24 +33,15 @@
 
        private static $hasSetup;
 
-       /**
-        * @var TestUser
-        */
-       private static $wbBotUser;
-
        protected function setUp() {
                parent::setUp();
 
-               if ( !isset( self::$wbBotUser ) ) {
-                       self::$wbBotUser = new TestUser(
-                               'Apitestbot',
-                               'Api Test Bot',
-                               '[email protected]',
-                               array( 'bot' )
-                       );
-               }
-
-               ApiTestCase::$users['wbbot'] = self::$wbBotUser;
+               ApiTestCase::$users['wbbot'] = new TestUser(
+                       'Apitestbot',
+                       'Api Test Bot',
+                       '[email protected]',
+                       array( 'bot' )
+               );
 
                if( !isset( self::$hasSetup ) ){
                        $this->initTestEntities( array( 'Empty' ) );
@@ -156,13 +147,13 @@
 
                $this->assertNotNull( $change, 'no change matching ID ' . $myid 
. ' found in recentchanges feed!' );
 
-               if( array_key_exists( 'new', $expected ) ){
+               if ( array_key_exists( 'new', $expected ) ){
                        $this->assertTrue( $expected['new'] == 
array_key_exists( 'new', $change ),
-                               "Must" . ( $expected['new'] ? '' : ' not ' ) . 
"have a 'new' key in the rc-entry of the result from the API" );
+                               "Must " . ( $expected['new'] ? '' : 'not ' ) . 
"have a 'new' key in the rc-entry of the result from the API" );
                }
-               if( array_key_exists( 'bot', $expected ) ){
+               if ( array_key_exists( 'bot', $expected ) ){
                        $this->assertTrue( $expected['bot'] == 
array_key_exists( 'bot', $change ),
-                               "Must" . ( $expected['bot'] ? '' : ' not ' ) . 
"have a 'bot' key in the rc-entry of the result from the API" );
+                               "Must " . ( $expected['bot'] ? '' : 'not ' ) . 
"have a 'bot' key in the rc-entry of the result from the API" );
                }
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7aefc6527a38ce72bb58cf5025d8428dddf1c265
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>

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

Reply via email to