Avoid using User::getOptionKinds()

User::getOptionKinds() is deprecated and should be replaced with UserOptionsManager::getOptionKinds()

Bug: T277600
Change-Id: Ie30ae74839f91aa48c53a5ebf680adb21eb9b047
This commit is contained in:
Alexander Vorwerk 2021-05-03 12:43:35 +02:00 committed by Zabe
parent 6fd33d774f
commit 6bf535cffc
2 changed files with 4 additions and 2 deletions

View file

@ -12,7 +12,7 @@
"type": "editor",
"license-name": "GPL-2.0-or-later",
"requires": {
"MediaWiki": ">= 1.34.0"
"MediaWiki": ">= 1.35.0"
},
"config": {
"CodeMirrorEnableBracketMatching": {

View file

@ -3,6 +3,7 @@
namespace CodeMirror\Tests;
use CodeMirrorHooks;
use MediaWiki\MediaWikiServices;
use MediaWikiTestCase;
use RequestContext;
@ -41,7 +42,8 @@ class HookTest extends MediaWikiTestCase {
public function testPreferenceRegistered() {
$user = self::getTestUser()->getUser();
$this->setMwGlobals( 'wgTitle', \Title::newFromText( __METHOD__ ) );
$kinds = $user->getOptionKinds( RequestContext::getMain(), [ 'usecodemirror' => 1 ] );
$kinds = MediaWikiServices::getInstance()->getUserOptionsManager()
->getOptionKinds( $user, RequestContext::getMain(), [ 'usecodemirror' => 1 ] );
self::assertEquals( 'registered', $kinds['usecodemirror'] );
}
}