Merge "RequestContext: Load the request object for getRequest on first call"
[lhc/web/wiklou.git] / tests / phpunit / includes / media / FormatMetadataTest.php
index 97aa0a3..22383e1 100644 (file)
@@ -36,39 +36,6 @@ class FormatMetadataTest extends MediaWikiMediaTestCase {
                        'File with invalid date metadata (bug 29471)' );
        }
 
-       /**
-        * @param string $filename
-        * @param int $expected Total image area
-        * @dataProvider provideFlattenArray
-        * @covers FormatMetadata::flattenArray
-        */
-       public function testFlattenArray( $vals, $type, $noHtml, $ctx, $expected ) {
-               $actual = FormatMetadata::flattenArray( $vals, $type, $noHtml, $ctx );
-               $this->assertEquals( $expected, $actual );
-       }
-
-       public static function provideFlattenArray() {
-               return array(
-                       array(
-                               array( 1, 2, 3 ), 'ul', false, false,
-                               "<ul><li>1</li>\n<li>2</li>\n<li>3</li></ul>",
-                       ),
-                       array(
-                               array( 1, 2, 3 ), 'ol', false, false,
-                               "<ol><li>1</li>\n<li>2</li>\n<li>3</li></ol>",
-                       ),
-                       array(
-                               array( 1, 2, 3 ), 'ul', true, false,
-                               "\n*1\n*2\n*3",
-                       ),
-                       array(
-                               array( 1, 2, 3 ), 'ol', true, false,
-                               "\n#1\n#2\n#3",
-                       ),
-                       // TODO: more test cases
-               );
-       }
-
        /**
         * @param mixed $input
         * @param mixed $output
@@ -86,18 +53,46 @@ class FormatMetadataTest extends MediaWikiMediaTestCase {
 
        public function provideResolveMultivalueValue() {
                return array(
-                       'nonArray' => array( 'foo', 'foo' ),
-                       'multiValue' => array( array( 'first', 'second', 'third', '_type' => 'ol' ), 'first' ),
-                       'noType' => array( array( 'first', 'second', 'third' ), 'first' ),
-                       'typeFirst' => array( array( '_type' => 'ol', 'first', 'second', 'third' ), 'first' ),
-                   'multilang' => array(
-                           array( 'en' => 'first', 'de' => 'Erste', '_type' => 'lang' ),
-                           array( 'en' => 'first', 'de' => 'Erste', '_type' => 'lang' ),
-                   ),
-                   'multilang-multivalue' => array(
-                           array( 'en' => array( 'first', 'second' ), 'de' => array( 'Erste', 'Zweite' ), '_type' => 'lang' ),
-                           array( 'en' => 'first', 'de' => 'Erste', '_type' => 'lang' ),
-                   ),
+                       'nonArray' => array(
+                               'foo',
+                               'foo'
+                       ),
+                       'multiValue' => array(
+                               array( 'first', 'second', 'third', '_type' => 'ol' ),
+                               'first'
+                       ),
+                       'noType' => array(
+                               array( 'first', 'second', 'third' ),
+                               'first'
+                       ),
+                       'typeFirst' => array(
+                               array( '_type' => 'ol', 'first', 'second', 'third' ),
+                               'first'
+                       ),
+                       'multilang' => array(
+                               array(
+                                       'en' => 'first',
+                                       'de' => 'Erste',
+                                       '_type' => 'lang'
+                               ),
+                               array(
+                                       'en' => 'first',
+                                       'de' => 'Erste',
+                                       '_type' => 'lang'
+                               ),
+                       ),
+                       'multilang-multivalue' => array(
+                               array(
+                                       'en' => array( 'first', 'second' ),
+                                       'de' => array( 'Erste', 'Zweite' ),
+                                       '_type' => 'lang'
+                               ),
+                               array(
+                                       'en' => 'first',
+                                       'de' => 'Erste',
+                                       '_type' => 'lang'
+                               ),
+                       ),
                );
        }
 }