From 3a0c4b1f3ed98a58e2e09a4e4306da201868babb Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 20 May 2022 12:11:31 +1000 Subject: [PATCH] Use new ResourceLoader namespace Extensions using Phan need to be updated simultaneously with core due to T308443. Bug: T308718 Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659 Change-Id: I47dad71df97f38c55550f71baf6dae67dbe0a2ba --- includes/ResourceLoaderCodeMirrorModule.php | 9 ++++----- tests/phpunit/ResourceLoaderCodeMirrorModuleTest.php | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/ResourceLoaderCodeMirrorModule.php b/includes/ResourceLoaderCodeMirrorModule.php index 29bafd1f..91eeb739 100644 --- a/includes/ResourceLoaderCodeMirrorModule.php +++ b/includes/ResourceLoaderCodeMirrorModule.php @@ -24,18 +24,17 @@ namespace MediaWiki\Extension\CodeMirror; use ExtensionRegistry; use MediaWiki\MediaWikiServices; -use ResourceLoader; -use ResourceLoaderContext; -use ResourceLoaderFileModule; +use MediaWiki\ResourceLoader as RL; +use MediaWiki\ResourceLoader\ResourceLoader; /** * ResourceLoader module for ext.CodeMirror */ -class ResourceLoaderCodeMirrorModule extends ResourceLoaderFileModule { +class ResourceLoaderCodeMirrorModule extends RL\FileModule { /** * @inheritDoc */ - public function getScript( ResourceLoaderContext $context ) { + public function getScript( RL\Context $context ) { return ResourceLoader::makeConfigSetScript( [ 'extCodeMirrorConfig' => $this->getFrontendConfiguraton() ] ) diff --git a/tests/phpunit/ResourceLoaderCodeMirrorModuleTest.php b/tests/phpunit/ResourceLoaderCodeMirrorModuleTest.php index 2aaa8717..cdd3b836 100644 --- a/tests/phpunit/ResourceLoaderCodeMirrorModuleTest.php +++ b/tests/phpunit/ResourceLoaderCodeMirrorModuleTest.php @@ -3,7 +3,7 @@ namespace MediaWiki\Extension\CodeMirror\Tests; use MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule; -use ResourceLoaderContext; +use MediaWiki\ResourceLoader\Context; /** * @covers \MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule @@ -11,7 +11,7 @@ use ResourceLoaderContext; class ResourceLoaderCodeMirrorModuleTest extends \MediaWikiIntegrationTestCase { public function testResourceLoaderModule() { - $context = $this->createMock( ResourceLoaderContext::class ); + $context = $this->createMock( Context::class ); $module = new ResourceLoaderCodeMirrorModule(); $this->assertFalse( $module->supportsURLLoading() );