Phuedx has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332152 )

Change subject: Forward PopupsBetaFeature to the client
......................................................................

Forward PopupsBetaFeature to the client

Bug: T146889
Change-Id: I66739b01e405bd7be29e912388005e0bb1f25b3f
---
M Popups.hooks.php
M tests/phpunit/PopupsHooksTest.php
2 files changed, 15 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/52/332152/1

diff --git a/Popups.hooks.php b/Popups.hooks.php
index 807ffae..29cb9ab 100644
--- a/Popups.hooks.php
+++ b/Popups.hooks.php
@@ -142,6 +142,7 @@
        public static function onResourceLoaderGetConfigVars( array &$vars ) {
                $conf = PopupsContext::getInstance()->getConfig();
                $vars['wgPopupsSchemaSamplingRate'] = $conf->get( 
'PopupsSchemaSamplingRate' );
+               $vars['wgPopupsBetaFeature'] = $conf->get( 'PopupsBetaFeature' 
);
        }
 
        /**
diff --git a/tests/phpunit/PopupsHooksTest.php 
b/tests/phpunit/PopupsHooksTest.php
index dc30481..0223f59 100644
--- a/tests/phpunit/PopupsHooksTest.php
+++ b/tests/phpunit/PopupsHooksTest.php
@@ -188,11 +188,21 @@
         */
        public function testOnResourceLoaderGetConfigVars() {
                $vars = [ 'something' => 'notEmpty' ];
-               $value = 10;
-               $this->setMwGlobals( [ 'wgPopupsSchemaSamplingRate' => $value ] 
);
+               $config = [
+                       'wgPopupsSchemaSamplingRate' => 10,
+                       'wgPopupsBetaFeature' => true,
+               ];
+               $this->setMwGlobals( $config );
                PopupsHooks::onResourceLoaderGetConfigVars( $vars );
-               $this->assertCount( 2, $vars );
-               $this->assertEquals( $value, $vars[ 
'wgPopupsSchemaSamplingRate' ] );
+               $this->assertCount( 3, $vars );
+
+               foreach ( $config as $key => $value ) {
+                       $this->assertEquals(
+                               $value,
+                               $vars[ $key ],
+                               "It forwards the \"{$key}\" config variable to 
the client."
+                       );
+               }
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/332152
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66739b01e405bd7be29e912388005e0bb1f25b3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: mpga
Gerrit-Owner: Phuedx <samsm...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to