mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-30 08:54:13 +00:00
Restore GetPreferences hook handler registration
Accidentally removed in I1ad451acfd1 Bug: T198537 Change-Id: I71788de31a23373f4e0528211ce3ec89fc5f9d3b
This commit is contained in:
parent
c8ae93806c
commit
c8f75d5ac5
|
@ -146,7 +146,12 @@
|
|||
"BeforePageDisplay": [
|
||||
"CodeMirrorHooks::onBeforePageDisplay"
|
||||
],
|
||||
"ResourceLoaderTestModules": "CodeMirrorHooks::onResourceLoaderTestModules"
|
||||
"GetPreferences": [
|
||||
"CodeMirrorHooks::onGetPreferences"
|
||||
],
|
||||
"ResourceLoaderTestModules": [
|
||||
"CodeMirrorHooks::onResourceLoaderTestModules"
|
||||
]
|
||||
},
|
||||
"VisualEditorPluginModules": [
|
||||
"ext.CodeMirror.visualEditor.init",
|
||||
|
|
21
tests/phpunit/HookTest.php
Normal file
21
tests/phpunit/HookTest.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace CodeMirror\Tests;
|
||||
|
||||
use MediaWikiTestCase;
|
||||
use RequestContext;
|
||||
|
||||
/**
|
||||
* @group CodeMirror
|
||||
*/
|
||||
class HookTest extends MediaWikiTestCase {
|
||||
/**
|
||||
* @covers CodeMirrorHooks::onGetPreferences()
|
||||
*/
|
||||
public function testPreferenceRegistered() {
|
||||
$user = self::getTestUser()->getUser();
|
||||
$this->setMwGlobals( 'wgTitle', \Title::newFromText( __METHOD__ ) );
|
||||
$kinds = $user->getOptionKinds( RequestContext::getMain(), [ 'usecodemirror' => 1 ] );
|
||||
self::assertEquals( 'registered', $kinds['usecodemirror'] );
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue