Merge "Avoid wgTitle in tests"

This commit is contained in:
jenkins-bot 2024-03-07 19:21:51 +00:00 committed by Gerrit Code Review
commit 210f78aa90

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