Avoid wgTitle in tests

Change-Id: I1323b9b9542598d33f7150cc0d468e581b0d8c09
This commit is contained in:
Fomafix 2024-03-06 15:59:33 +00:00
parent 7002bc434d
commit b4b1004499

View file

@ -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'] );
}