aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes')
-rw-r--r--tests/phpunit/includes/GlobalFunctions/WfExpandUrlTest.php2
-rw-r--r--tests/phpunit/includes/OutputPageTest.php4
-rw-r--r--tests/phpunit/includes/api/ApiTestCase.php2
-rw-r--r--tests/phpunit/includes/block/BlockManagerTest.php6
-rw-r--r--tests/phpunit/includes/user/UserTest.php4
5 files changed, 8 insertions, 10 deletions
diff --git a/tests/phpunit/includes/GlobalFunctions/WfExpandUrlTest.php b/tests/phpunit/includes/GlobalFunctions/WfExpandUrlTest.php
index d5171ec898b9..e053ab4f9e4f 100644
--- a/tests/phpunit/includes/GlobalFunctions/WfExpandUrlTest.php
+++ b/tests/phpunit/includes/GlobalFunctions/WfExpandUrlTest.php
@@ -15,9 +15,9 @@ class WfExpandUrlTest extends MediaWikiIntegrationTestCase {
$this->setMwGlobals( [
'wgServer' => $server,
'wgCanonicalServer' => $canServer,
- 'wgRequest' => new FauxRequest( [], false, null, $httpsMode ? 'https' : 'http' ),
'wgHttpsPort' => $httpsPort
] );
+ $this->setRequest( new FauxRequest( [], false, null, $httpsMode ? 'https' : 'http' ) );
$this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message );
}
diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php
index 6bc9322426a2..4ee1770d61b7 100644
--- a/tests/phpunit/includes/OutputPageTest.php
+++ b/tests/phpunit/includes/OutputPageTest.php
@@ -2799,9 +2799,7 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
}
$fauxRequest = new FauxRequest( $queryData, false );
- $this->setMwGlobals( [
- 'wgRequest' => $fauxRequest,
- ] );
+ $this->setRequest( $fauxRequest );
$actualReturn = OutputPage::transformCssMedia( $args['media'] );
$this->assertSame( $args['expectedReturn'], $actualReturn, $args['message'] );
diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php
index 780ddea9f9cf..3764ee439a13 100644
--- a/tests/phpunit/includes/api/ApiTestCase.php
+++ b/tests/phpunit/includes/api/ApiTestCase.php
@@ -28,8 +28,8 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
'uploader' => static::getTestUser(),
];
+ $this->setRequest( new FauxRequest( [] ) );
$this->setMwGlobals( [
- 'wgRequest' => new FauxRequest( [] ),
'wgUser' => self::$users['sysop']->getUser(),
] );
diff --git a/tests/phpunit/includes/block/BlockManagerTest.php b/tests/phpunit/includes/block/BlockManagerTest.php
index 2d95211adb84..6c39c9daf208 100644
--- a/tests/phpunit/includes/block/BlockManagerTest.php
+++ b/tests/phpunit/includes/block/BlockManagerTest.php
@@ -116,14 +116,16 @@ class BlockManagerTest extends MediaWikiIntegrationTestCase {
$user = $options['loggedIn'] ? $this->user : new User();
$user->getRequest()->setCookie( 'BlockID', $blockManager->getCookieValue( $block ) );
+ $response = new FauxResponse;
+
$blockManager->trackBlockWithCookie(
$user,
- $user->getRequest()->response()
+ $response
);
$this->assertCount(
$expectKeepCookie ? 0 : 1,
- $user->getRequest()->response()->getCookies()
+ $response->getCookies()
);
$blockStore->deleteBlock( $block );
diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php
index 5fd906620961..d0138715be89 100644
--- a/tests/phpunit/includes/user/UserTest.php
+++ b/tests/phpunit/includes/user/UserTest.php
@@ -1231,9 +1231,7 @@ class UserTest extends MediaWikiIntegrationTestCase {
*/
public function testSessionAndRequest() {
$req1 = new WebRequest;
- $this->setMwGlobals( [
- 'wgRequest' => $req1,
- ] );
+ $this->setRequest( $req1 );
$user = User::newFromSession();
$request = $user->getRequest();