From e963203737fc8dbc08a48b9efbe148900ed5832d Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Mon, 29 Apr 2024 11:16:32 +0200 Subject: [PATCH] Fix SkinModule class --- src/Hooks/ResourceLoaderRegisterModules.php | 3 ++- .../phpunit/Unit/Hooks/ResourceLoaderRegisterModulesTest.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Hooks/ResourceLoaderRegisterModules.php b/src/Hooks/ResourceLoaderRegisterModules.php index 914207c1..90dde3bc 100644 --- a/src/Hooks/ResourceLoaderRegisterModules.php +++ b/src/Hooks/ResourceLoaderRegisterModules.php @@ -27,6 +27,7 @@ namespace Skins\Chameleon\Hooks; use MediaWiki\ResourceLoader\ResourceLoader; +use MediaWiki\ResourceLoader\SkinModule; /** * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderRegisterModules @@ -59,7 +60,7 @@ private function registerBootstrap(): void { private function registerChameleon(): void { $this->resourceLoader->register( 'skins.chameleon', [ - 'class' => 'ResourceLoaderSkinModule', + 'class' => SkinModule::class, 'features' => $this->getFeatures(), 'targets' => [ 'desktop', diff --git a/tests/phpunit/Unit/Hooks/ResourceLoaderRegisterModulesTest.php b/tests/phpunit/Unit/Hooks/ResourceLoaderRegisterModulesTest.php index 22b80854..7d3df142 100644 --- a/tests/phpunit/Unit/Hooks/ResourceLoaderRegisterModulesTest.php +++ b/tests/phpunit/Unit/Hooks/ResourceLoaderRegisterModulesTest.php @@ -25,6 +25,7 @@ namespace Skins\Chameleon\Tests\Unit\Hooks; use MediaWiki\ResourceLoader\ResourceLoader; +use MediaWiki\ResourceLoader\SkinModule; use PHPUnit\Framework\TestCase; use Skins\Chameleon\Hooks\ResourceLoaderRegisterModules; @@ -84,7 +85,7 @@ public function testProcess() { ->withConsecutive( [ 'zzz.ext.bootstrap.styles', [ 'foo' => 'bar' ] ], [ 'skins.chameleon', [ - 'class' => 'ResourceLoaderSkinModule', + 'class' => SkinModule::class, 'features' => $this->getBaseFeatures(), 'targets' => [ 'desktop', @@ -119,7 +120,7 @@ public function testProcessWithExternalLinkIconsEnabled() { ->withConsecutive( [ 'zzz.ext.bootstrap.styles', [ 'foo' => 'bar' ] ], [ 'skins.chameleon', [ - 'class' => 'ResourceLoaderSkinModule', + 'class' => SkinModule::class, 'features' => $features, 'targets' => [ 'desktop',