jenkins-bot has submitted this change and it was merged. Change subject: Implement support for 'hidden' feature in MediaWikiGadgetsDefinitionRepo ......................................................................
Implement support for 'hidden' feature in MediaWikiGadgetsDefinitionRepo Follows-up 152484566, which added support for it in Gadgets 2.0, but it's easy enough to make it work in existing definitions as well. That way, people can stop using 'rights=hidden' hacks. Bug: T33150 Change-Id: Idd6944a9ad38279e117c1a02a4b5fd0343455ba0 (cherry picked from commit 27a0ca656837156490edc016371de2cde2d1fcfd) --- M includes/MediaWikiGadgetsDefinitionRepo.php M tests/phpunit/GadgetTest.php 2 files changed, 14 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWikiGadgetsDefinitionRepo.php b/includes/MediaWikiGadgetsDefinitionRepo.php index dbb3ae8..9ce192b 100644 --- a/includes/MediaWikiGadgetsDefinitionRepo.php +++ b/includes/MediaWikiGadgetsDefinitionRepo.php @@ -202,6 +202,9 @@ case 'rights': $info['requiredRights'] = $params; break; + case 'hidden': + $info['hidden'] = true; + break; case 'skins': $info['requiredSkins'] = $params; break; diff --git a/tests/phpunit/GadgetTest.php b/tests/phpunit/GadgetTest.php index a327a2a..789082c 100644 --- a/tests/phpunit/GadgetTest.php +++ b/tests/phpunit/GadgetTest.php @@ -132,6 +132,17 @@ $this->assertEquals( $mType, $this->getModule( $g )->getType(), "Module: $message" ); } + public function testIsHidden() { + $g = $this->create( '* foo[hidden]|bar.js' ); + $this->assertTrue( $g->isHidden() ); + + $g = $this->create( '* foo[ResourceLoader|hidden]|bar.js' ); + $this->assertTrue( $g->isHidden() ); + + $g = $this->create( '* foo[ResourceLoader]|bar.js' ); + $this->assertFalse( $g->isHidden() ); + } + public function testPreferences() { $prefs = array(); $repo = TestingAccessWrapper::newFromObject( new MediaWikiGadgetsDefinitionRepo() ); -- To view, visit https://gerrit.wikimedia.org/r/323116 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd6944a9ad38279e117c1a02a4b5fd0343455ba0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Gadgets Gerrit-Branch: REL1_28 Gerrit-Owner: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits