Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/77904
Change subject: TestBase now uses parent doLogin correctly
......................................................................
TestBase now uses parent doLogin correctly
Change-Id: I23431b1aabb682fcbecc74249b0876e77a31c839
---
M repo/tests/phpunit/includes/api/BotEditTest.php
M repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
2 files changed, 5 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/04/77904/1
diff --git a/repo/tests/phpunit/includes/api/BotEditTest.php
b/repo/tests/phpunit/includes/api/BotEditTest.php
index 5d0108a..a5df48f 100644
--- a/repo/tests/phpunit/includes/api/BotEditTest.php
+++ b/repo/tests/phpunit/includes/api/BotEditTest.php
@@ -74,7 +74,7 @@
'wgUser' => self::$users['wbbot']->user,
) );
- $this->login( 'wbbot' );
+ $this->doLogin( 'wbbot' );
}
/**
diff --git a/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
b/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
index 3437004..5766946 100644
--- a/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
+++ b/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
@@ -57,8 +57,6 @@
protected static $entityInput = null; // entities in input format,
using handles as keys
protected static $entityOutput = array(); // entities in output format,
using handles as keys
- protected static $loginUser = null;
-
public function setUp() {
parent::setUp();
@@ -79,7 +77,7 @@
'wgUser' => self::$users['wbeditor']->user,
) );
- $this->login();
+ $this->doLogin();
self::initEntities();
}
@@ -247,20 +245,12 @@
);
}
- /**
- * Performs a login, if necessary, and returns the resulting session.
- */
- function login( $user = 'wbeditor' ) {
- $data = self::doLogin( $user );
- self::$loginUser = self::$users[ $user ];
- return $data;
+ function doLogin( $user = 'wbeditor' ) {
+ return parent::doLogin( $user );
}
- /**
- * Gets an entity edit token.
- */
function getToken( $type = 'edittoken' ) {
- $tokens = self::getTokenList( self::$loginUser );
+ $tokens = self::getTokenList( null );
return $tokens[$type];
}
--
To view, visit https://gerrit.wikimedia.org/r/77904
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I23431b1aabb682fcbecc74249b0876e77a31c839
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits