Dereckson has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/344798 )
Change subject: Test wgLogoHD keys
......................................................................
Test wgLogoHD keys
When a value is defined, keys MUST be 1.5x and 2x.
Bug: T161416
Change-Id: I41196e2756eff07cdcecedcde06b141b77621789
---
A tests/InitialiseSettingsTest.php
1 file changed, 50 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/98/344798/1
diff --git a/tests/InitialiseSettingsTest.php b/tests/InitialiseSettingsTest.php
new file mode 100644
index 0000000..502f5e1
--- /dev/null
+++ b/tests/InitialiseSettingsTest.php
@@ -0,0 +1,50 @@
+<?php
+
+require_once __DIR__ . '/SiteConfiguration.php';
+
+class InitialiseSettingsTest extends PHPUnit_Framework_TestCase {
+
+ protected $settings;
+
+ protected function setUp() {
+ $this->settings = $this->loadSettings( 'unittest' );
+ }
+
+ private function loadSettings( $wmfRealm ) {
+ // Variables required for wgConf.php
+ $wmfConfigDir = __DIR__ . "/../wmf-config";
+
+ require "{$wmfConfigDir}/wgConf.php";
+
+ // InitialiseSettings.php explicitly declares these as global,
so we must too
+ $GLOBALS['wmfUdp2logDest'] = 'localhost';
+ $GLOBALS['wmfDatacenter'] = 'unittest';
+ $GLOBALS['wmfMasterDatacenter'] = 'unittest';
+ $GLOBALS['wmfRealm'] = $wmfRealm;
+ $GLOBALS['wmfConfigDir'] = $wmfConfigDir;
+ $GLOBALS['wgConf'] = $wgConf;
+
+ require __DIR__ . '/TestServices.php';
+ require "{$wmfConfigDir}/InitialiseSettings.php";
+
+ return $wgConf->settings;
+ }
+
+ ///
+ /// wgLogoHD
+ ///
+
+ public function testLogoHD () {
+ $requiredKeys = $this->getRequiredLogoHDKeys();
+
+ foreach ( $this->settings[ 'wgLogoHD' ] as $db => $entry ) {
+ $keys = array_keys( $entry );
+ $this->assertEquals( $requiredKeys, $keys, "Unexpected
keys for $db", 0.0, 10, true ); // canonicalize
+ }
+ }
+
+ public function getRequiredLogoHDKeys () {
+ return [ '1.5x', '2x' ];
+ }
+
+}
--
To view, visit https://gerrit.wikimedia.org/r/344798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I41196e2756eff07cdcecedcde06b141b77621789
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits