mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-18 00:30:30 +00:00
Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681 Change-Id: I4ac93c24d2c90d51532fc3c39e60efbb4f8f8bfb
This commit is contained in:
parent
7a49382bdf
commit
e1fb56e38e
|
@ -3,6 +3,7 @@
|
||||||
namespace MediaWiki\Extension\CodeMirror\Tests;
|
namespace MediaWiki\Extension\CodeMirror\Tests;
|
||||||
|
|
||||||
use MediaWiki\Extension\CodeMirror\Hooks;
|
use MediaWiki\Extension\CodeMirror\Hooks;
|
||||||
|
use MediaWiki\Title\Title;
|
||||||
use MediaWiki\User\UserOptionsLookup;
|
use MediaWiki\User\UserOptionsLookup;
|
||||||
use MediaWikiIntegrationTestCase;
|
use MediaWikiIntegrationTestCase;
|
||||||
use RequestContext;
|
use RequestContext;
|
||||||
|
@ -27,7 +28,7 @@ class HookTest extends MediaWikiIntegrationTestCase {
|
||||||
$out->method( 'getModules' )->willReturn( [] );
|
$out->method( 'getModules' )->willReturn( [] );
|
||||||
$out->method( 'getUser' )->willReturn( $this->createMock( \User::class ) );
|
$out->method( 'getUser' )->willReturn( $this->createMock( \User::class ) );
|
||||||
$out->method( 'getActionName' )->willReturn( 'edit' );
|
$out->method( 'getActionName' )->willReturn( 'edit' );
|
||||||
$out->method( 'getTitle' )->willReturn( \Title::makeTitle( NS_MAIN, __METHOD__ ) );
|
$out->method( 'getTitle' )->willReturn( Title::makeTitle( NS_MAIN, __METHOD__ ) );
|
||||||
$out->expects( $this->exactly( 2 ) )->method( 'addModules' );
|
$out->expects( $this->exactly( 2 ) )->method( 'addModules' );
|
||||||
|
|
||||||
( new Hooks( $userOptionsLookup ) )
|
( new Hooks( $userOptionsLookup ) )
|
||||||
|
@ -39,7 +40,7 @@ class HookTest extends MediaWikiIntegrationTestCase {
|
||||||
*/
|
*/
|
||||||
public function testPreferenceRegistered() {
|
public function testPreferenceRegistered() {
|
||||||
$user = self::getTestUser()->getUser();
|
$user = self::getTestUser()->getUser();
|
||||||
$this->setMwGlobals( 'wgTitle', \Title::newFromText( __METHOD__ ) );
|
$this->setMwGlobals( 'wgTitle', Title::newFromText( __METHOD__ ) );
|
||||||
$kinds = $this->getServiceContainer()->getUserOptionsManager()
|
$kinds = $this->getServiceContainer()->getUserOptionsManager()
|
||||||
->getOptionKinds( $user, RequestContext::getMain(), [ 'usecodemirror' => 1 ] );
|
->getOptionKinds( $user, RequestContext::getMain(), [ 'usecodemirror' => 1 ] );
|
||||||
self::assertEquals( 'registered', $kinds['usecodemirror'] );
|
self::assertEquals( 'registered', $kinds['usecodemirror'] );
|
||||||
|
|
Loading…
Reference in a new issue