jenkins-bot has submitted this change and it was merged.
Change subject: Allow us to get different types of tokens
......................................................................
Allow us to get different types of tokens
This is a slight work around waiting for core
Change-Id: Iaa949bae696dad98756e6c99b910e22eb476b0bc
---
M repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
1 file changed, 6 insertions(+), 6 deletions(-)
Approvals:
Tobias Gritschacher: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
b/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
index ad9ff34..5849c09 100644
--- a/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
+++ b/repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
@@ -277,16 +277,16 @@
/**
* Gets an entity edit token.
*/
- function getEditToken() {
+ function getToken( $type = 'edittoken' ) {
$tokens = self::getTokenList( self::$loginUser );
- return $tokens['edittoken'];
+ return $tokens[$type];
}
/**
* Appends an edit token to a request
*/
function doApiRequestWithToken( array $params, array $session = null,
User $user = null ) {
- $params['token'] = $this->getEditToken();
+ $params['token'] = $this->getToken();
return $this->doApiRequest( $params, $session, false, $user );
}
@@ -300,7 +300,7 @@
}
self::initEntities();
- $token = $this->getEditToken();
+ $token = $this->getToken();
foreach ( self::$entityInput as $entity ) {
$handle = $entity['handle'];
@@ -315,7 +315,7 @@
*/
function resetEntities() {
$this->createEntities();
- $token = $this->getEditToken();
+ $token = $this->getToken();
foreach ( self::$entityInput as $handle => $entity ) {
$entity['id'] = $this->getEntityId( $handle );
@@ -333,7 +333,7 @@
$entity = $this->getEntityInput( $handle );
$entity['id'] = $this->getEntityId( $handle );
- $token = $this->getEditToken();
+ $token = $this->getToken();
$data = $this->setEntity( $entity, $token );
self::$entityOutput[ $handle ] = $data;
--
To view, visit https://gerrit.wikimedia.org/r/77887
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa949bae696dad98756e6c99b910e22eb476b0bc
Gerrit-PatchSet: 4
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