Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249057
Change subject: Remove position default logic
......................................................................
Remove position default logic
Follows-up 3e05e38.
See also Ib9821b7b87 in MediaWiki core.
Change-Id: If385f4c9bcf88b824099effa3c5b93545f372e82
---
M ResourceLoaderGlobalModule.php
M tests/ResourceLoaderGlobalModuleTest.php
2 files changed, 1 insertion(+), 18 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalCssJs
refs/changes/57/249057/1
diff --git a/ResourceLoaderGlobalModule.php b/ResourceLoaderGlobalModule.php
index 7117f88..291c81d 100644
--- a/ResourceLoaderGlobalModule.php
+++ b/ResourceLoaderGlobalModule.php
@@ -46,11 +46,9 @@
public function __construct( $options ) {
foreach ( $options as $member => $option ) {
switch ( $member ) {
- case 'position':
- $this->isPositionDefined = true;
- // fall through
case 'wiki':
case 'source':
+ case 'position':
$this->{$member} = (string)$option;
break;
}
diff --git a/tests/ResourceLoaderGlobalModuleTest.php
b/tests/ResourceLoaderGlobalModuleTest.php
index 850ff51..27cafad 100644
--- a/tests/ResourceLoaderGlobalModuleTest.php
+++ b/tests/ResourceLoaderGlobalModuleTest.php
@@ -35,19 +35,4 @@
),
);
}
-
- /**
- * Verify that all style modules are setting an explicit position
- *
- * @covers ResourceLoaderGlobalModule::isPositionDefault
- */
- public function testIsPositionDefault() {
- $this->setMwGlobals(
- 'wgGlobalCssJsConfig',
- array( 'wiki' => wfWikiID(), 'source' => 'fakesource' )
- );
- $rl = new ResourceLoader(
ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) );
- $this->assertTrue( !$rl->getModule(
'ext.globalCssJs.user.styles' )->isPositionDefault() );
- $this->assertTrue( !$rl->getModule(
'ext.globalCssJs.site.styles' )->isPositionDefault() );
- }
}
--
To view, visit https://gerrit.wikimedia.org/r/249057
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If385f4c9bcf88b824099effa3c5b93545f372e82
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalCssJs
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits