diff --git a/extension.json b/extension.json index d4b6048f..f76cfd01 100644 --- a/extension.json +++ b/extension.json @@ -12,7 +12,7 @@ "type": "editor", "license-name": "GPL-2.0-or-later", "requires": { - "MediaWiki": ">= 1.34.0" + "MediaWiki": ">= 1.35.0" }, "config": { "CodeMirrorEnableBracketMatching": { diff --git a/tests/phpunit/HookTest.php b/tests/phpunit/HookTest.php index 067fa7b4..27f20b8e 100644 --- a/tests/phpunit/HookTest.php +++ b/tests/phpunit/HookTest.php @@ -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'] ); } }