mediawiki-extensions-CodeMi.../tests/phpunit/HookTest.php
Max Semenik c8f75d5ac5 Restore GetPreferences hook handler registration
Accidentally removed in I1ad451acfd1

Bug: T198537
Change-Id: I71788de31a23373f4e0528211ce3ec89fc5f9d3b
2018-07-03 14:25:01 -07:00

22 lines
526 B
PHP

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