mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
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:
parent
6fd33d774f
commit
6bf535cffc
|
@ -12,7 +12,7 @@
|
|||
"type": "editor",
|
||||
"license-name": "GPL-2.0-or-later",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.34.0"
|
||||
"MediaWiki": ">= 1.35.0"
|
||||
},
|
||||
"config": {
|
||||
"CodeMirrorEnableBracketMatching": {
|
||||
|
|
|
@ -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'] );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue