From b4b10044999ac534822a9d0f3a70f0c8554b2ce1 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Wed, 6 Mar 2024 15:59:33 +0000 Subject: [PATCH] Avoid wgTitle in tests Change-Id: I1323b9b9542598d33f7150cc0d468e581b0d8c09 --- tests/phpunit/HookTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/HookTest.php b/tests/phpunit/HookTest.php index ed6e583a..8c4d648a 100644 --- a/tests/phpunit/HookTest.php +++ b/tests/phpunit/HookTest.php @@ -71,9 +71,10 @@ class HookTest extends MediaWikiIntegrationTestCase { */ public function testPreferenceRegistered() { $user = self::getTestUser()->getUser(); - $this->setMwGlobals( 'wgTitle', Title::newFromText( __METHOD__ ) ); + $context = RequestContext::getMain(); + $context->setTitle( Title::newFromText( __METHOD__ ) ); $kinds = $this->getServiceContainer()->getUserOptionsManager() - ->getOptionKinds( $user, RequestContext::getMain(), [ 'usecodemirror' => 1 ] ); + ->getOptionKinds( $user, $context, [ 'usecodemirror' => 1 ] ); self::assertEquals( 'registered', $kinds['usecodemirror'] ); }