Merge "Fix i18n message tog-watchlistunwatchlinks"
[lhc/web/wiklou.git] / tests / phpunit / includes / resourceloader / ResourceLoaderImageTest.php
index aea2776..35c3ef6 100644 (file)
@@ -15,8 +15,8 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase {
        protected function getTestImage( $name ) {
                $options = ResourceLoaderImageModuleTest::$commonImageData[$name];
                $fileDescriptor = is_string( $options ) ? $options : $options['file'];
-               $allowedVariants = is_array( $options ) &&
-                       isset( $options['variants'] ) ? $options['variants'] : [];
+               $allowedVariants = ( is_array( $options ) && isset( $options['variants'] ) ) ?
+                       $options['variants'] : [];
                $variants = array_fill_keys( $allowedVariants, [ 'color' => 'red' ] );
                return new ResourceLoaderImageTestable(
                        $name,
@@ -39,7 +39,9 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase {
                        [ 'mno', 'ar', 'mno-rtl.svg' ],
                        [ 'mno', 'he', 'mno-ltr.svg' ],
                        [ 'pqr', 'en', 'pqr-b.svg' ],
+                       [ 'pqr', 'en-gb', 'pqr-b.svg' ],
                        [ 'pqr', 'de', 'pqr-f.svg' ],
+                       [ 'pqr', 'de-formal', 'pqr-f.svg' ],
                        [ 'pqr', 'ar', 'pqr-f.svg' ],
                        [ 'pqr', 'fr', 'pqr-a.svg' ],
                        [ 'pqr', 'he', 'pqr-a.svg' ],
@@ -53,7 +55,9 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase {
        public function testGetPath( $imageName, $languageCode, $path ) {
                static $dirMap = [
                        'en' => 'ltr',
+                       'en-gb' => 'ltr',
                        'de' => 'ltr',
+                       'de-formal' => 'ltr',
                        'fr' => 'ltr',
                        'he' => 'rtl',
                        'ar' => 'rtl',