jenkins-bot has submitted this change and it was merged.
Change subject: ApiTestCase: Set correct user for derivate requests
......................................................................
ApiTestCase: Set correct user for derivate requests
RequestContext::getMain()->getUser() in a (faux) API request doesn't return the
user the (faux) API call is made with, but the user running the tests.
Bug: T101388
Change-Id: Icbbf14a6433edf5c91162a9d67899d6a2d5c33df
---
M tests/phpunit/includes/api/ApiTestCase.php
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/includes/api/ApiTestCase.php
b/tests/phpunit/includes/api/ApiTestCase.php
index da62bb0..21345ac 100644
--- a/tests/phpunit/includes/api/ApiTestCase.php
+++ b/tests/phpunit/includes/api/ApiTestCase.php
@@ -105,6 +105,7 @@
$wgRequest = new FauxRequest( $params, true, $session );
RequestContext::getMain()->setRequest( $wgRequest );
+ RequestContext::getMain()->setUser( $wgUser );
// set up local environment
$context = $this->apiContext->newTestContext( $wgRequest,
$wgUser );
--
To view, visit https://gerrit.wikimedia.org/r/216054
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icbbf14a6433edf5c91162a9d67899d6a2d5c33df
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits