Merge "Fix CLI installer when --dbname is not specified on command line."
[lhc/web/wiklou.git] / tests / phpunit / includes / media / GIFTest.php
index 52a51cc..de1e153 100644 (file)
@@ -116,7 +116,7 @@ class GIFHandlerTest extends MediaWikiMediaTestCase {
                $this->assertEquals( $expected, $actual );
        }
 
-       public function provideGetIndependentMetaArray() {
+       public static function provideGetIndependentMetaArray() {
                return array(
                        array( 'nonanimated.gif', array(
                                'GIFFileComment' => array(
@@ -139,4 +139,24 @@ class GIFHandlerTest extends MediaWikiMediaTestCase {
                        ),
                );
        }
+
+       /**
+        * @param $filename string
+        * @param $expectedLength float
+        * @dataProvider provideGetLength
+        */
+       public function testGetLength( $filename, $expectedLength ) {
+               $file = $this->dataFile( $filename, 'image/gif' );
+               $actualLength = $file->getLength();
+               $this->assertEquals( $expectedLength, $actualLength, '', 0.00001 );
+       }
+
+       public function provideGetLength() {
+               return array(
+                       array( 'animated.gif', 2.4 ),
+                       array( 'animated-xmp.gif', 2.4 ),
+                       array( 'nonanimated', 0.0 ),
+                       array( 'Bishzilla_blink.gif', 1.4 ),
+               );
+       }
 }