Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/77886
Change subject: Also get our tokens from ApiTestCase
......................................................................
Also get our tokens from ApiTestCase
Change-Id: I830157d7c3ddefd1ec3a168bfb45c065df08265c
REQUIRES: I5d517eca7529dd57e1 IN CORE <<< ----------
---
M repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
M repo/tests/phpunit/includes/api/PermissionsTest.php
2 files changed, 3 insertions(+), 26 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/86/77886/1
diff --git a/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
b/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
index 0e20f8c..b30a85d 100644
--- a/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
+++ b/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
@@ -273,29 +273,11 @@
}
/**
- * Gets an entity edit token. Returns a cached token if available.
+ * Gets an entity edit token.
*/
function getEditToken() {
- if ( !self::$usetoken ) {
- return "";
- }
-
- $this->login();
-
- if ( self::$token ) {
- return self::$token;
- }
-
- list($re,,) = $this->doApiRequest(
- array(
- 'action' => 'tokens',
- 'type' => 'edit' ),
- null,
- false,
- self::$loginUser->user
- );
-
- return $re['tokens']['edittoken'];
+ $tokens = self::getTokenList( self::$loginUser );
+ return $tokens['edittoken'];
}
/**
diff --git a/repo/tests/phpunit/includes/api/PermissionsTest.php
b/repo/tests/phpunit/includes/api/PermissionsTest.php
index 9724b60..cdfb82c 100644
--- a/repo/tests/phpunit/includes/api/PermissionsTest.php
+++ b/repo/tests/phpunit/includes/api/PermissionsTest.php
@@ -83,11 +83,6 @@
parent::tearDown();
}
- function getTokens() {
- $re = $this->getTokenList( self::$users['sysop'] );
- return $re[0];
- }
-
function doPermissionsTest( $action, $params, $permissions = array(),
$expectedError = null, array $restore = array() ) {
global $wgUser;
--
To view, visit https://gerrit.wikimedia.org/r/77886
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I830157d7c3ddefd1ec3a168bfb45c065df08265c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits