dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45df715
)
ApiTestCase: Set correct user for derivate requests
author
Matthias Mullie
<git@mullie.eu>
Fri, 5 Jun 2015 09:52:40 +0000
(11:52 +0200)
committer
Legoktm
<legoktm.wikipedia@gmail.com>
Fri, 5 Jun 2015 17:37:14 +0000
(17:37 +0000)
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
tests/phpunit/includes/api/ApiTestCase.php
patch
|
blob
|
history
diff --git
a/tests/phpunit/includes/api/ApiTestCase.php
b/tests/phpunit/includes/api/ApiTestCase.php
index
da62bb0
..
21345ac
100644
(file)
--- a/
tests/phpunit/includes/api/ApiTestCase.php
+++ b/
tests/phpunit/includes/api/ApiTestCase.php
@@
-105,6
+105,7
@@
abstract class ApiTestCase extends MediaWikiLangTestCase {
$wgRequest = new FauxRequest( $params, true, $session );
RequestContext::getMain()->setRequest( $wgRequest );
+ RequestContext::getMain()->setUser( $wgUser );
// set up local environment
$context = $this->apiContext->newTestContext( $wgRequest, $wgUser );