Merge "test: disable hook when testing default preferences"
[lhc/web/wiklou.git] / includes / cache / localisation / LocalisationCache.php
index 90108eb..9cf7acf 100644 (file)
@@ -203,6 +203,7 @@ class LocalisationCache {
                                        break;
                                case 'db':
                                        $storeClass = LCStoreDB::class;
+                                       $storeConf['server'] = $conf['storeServer'] ?? [];
                                        break;
                                case 'array':
                                        $storeClass = LCStoreStaticArray::class;
@@ -215,6 +216,7 @@ class LocalisationCache {
                                                $storeClass = LCStoreCDB::class;
                                        } else {
                                                $storeClass = LCStoreDB::class;
+                                               $storeConf['server'] = $conf['storeServer'] ?? [];
                                        }
                                        break;
                                default:
@@ -524,7 +526,12 @@ class LocalisationCache {
                Wikimedia\restoreWarnings();
 
                if ( $_fileType == 'core' || $_fileType == 'extension' ) {
+
+                       // Lnguage files aren't required to contain all the possible variables, so suppress warnings
+                       // when variables don't exist in tests
+                       Wikimedia\suppressWarnings();
                        $data = compact( self::$allKeys );
+                       Wikimedia\restoreWarnings();
                } elseif ( $_fileType == 'aliases' ) {
                        $data = compact( 'aliases' );
                } else {
@@ -793,7 +800,7 @@ class LocalisationCache {
                return [
                        'core' => "$IP/languages/i18n",
                        'api' => "$IP/includes/api/i18n",
-                       'oojs-ui' => "$IP/resources/lib/oojs-ui/i18n",
+                       'oojs-ui' => "$IP/resources/lib/ooui/i18n",
                ] + $messagesDirs;
        }