Merge "Get timestamp from WikiPage, instead of Article"
[lhc/web/wiklou.git] / tests / phpunit / includes / media / WebPTest.php
index 285f280..b50fe80 100644 (file)
@@ -19,6 +19,7 @@ class WebPHandlerTest extends MediaWikiTestCase {
                $this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $this->tempFileName ) );
        }
        public function provideTestExtractMetaData() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        // Files from https://developers.google.com/speed/webp/gallery2
                        array( "\x52\x49\x46\x46\x90\x68\x01\x00\x57\x45\x42\x50\x56\x50\x38\x4C\x83\x68\x01\x00\x2F\x8F\x01\x4B\x10\x8D\x38\x6C\xDB\x46\x92\xE0\xE0\x82\x7B\x6C",
@@ -66,6 +67,7 @@ class WebPHandlerTest extends MediaWikiTestCase {
                        array( 'RIFF1234WEBPVP8                     ', false ),
                        array( 'RIFF1234WEBPVP8L                    ', false ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
        /**
@@ -75,12 +77,24 @@ class WebPHandlerTest extends MediaWikiTestCase {
                $this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $filename ) );
        }
        public function provideTestWithFileExtractMetaData() {
-               return array(
-                               array( __DIR__ . '/../../data/media/2_webp_ll.webp',
-                                       array( 'compression' => 'lossless', 'width' => 386, 'height' => 395 ) ),
-                               array( __DIR__ . '/../../data/media/2_webp_a.webp',
-                                       array( 'compression' => 'lossy', 'animated' => false, 'transparency' => true, 'width' => 386, 'height' => 395 ) ),
-               );
+               return [
+                       [ __DIR__ . '/../../data/media/2_webp_ll.webp',
+                               [
+                                       'compression' => 'lossless',
+                                       'width' => 386,
+                                       'height' => 395
+                               ]
+                       ],
+                       [ __DIR__ . '/../../data/media/2_webp_a.webp',
+                               [
+                                       'compression' => 'lossy',
+                                       'animated' => false,
+                                       'transparency' => true,
+                                       'width' => 386,
+                                       'height' => 395
+                               ]
+                       ],
+               ];
        }
 
        /**
@@ -91,15 +105,15 @@ class WebPHandlerTest extends MediaWikiTestCase {
                $this->assertEquals( $expectedResult, $handler->getImageSize( null, $path ) );
        }
        public function provideTestGetImageSize() {
-               return array(
+               return [
                        // Public domain files from https://developers.google.com/speed/webp/gallery2
-                       array( __DIR__ . '/../../data/media/2_webp_a.webp', array( 386, 395 ) ),
-                       array( __DIR__ . '/../../data/media/2_webp_ll.webp', array( 386, 395 ) ),
-                       array( __DIR__ . '/../../data/media/webp_animated.webp', array( 300, 225 ) ),
+                       [ __DIR__ . '/../../data/media/2_webp_a.webp', [ 386, 395 ] ],
+                       [ __DIR__ . '/../../data/media/2_webp_ll.webp', [ 386, 395 ] ],
+                       [ __DIR__ . '/../../data/media/webp_animated.webp', [ 300, 225 ] ],
 
                        // Error cases
-                       array( __FILE__, false ),
-               );
+                       [ __FILE__, false ],
+               ];
        }
 
        /**
@@ -113,12 +127,12 @@ class WebPHandlerTest extends MediaWikiTestCase {
                $this->assertEquals( 'image/webp', $mime->guessMimeType( $path, false ) );
        }
        public function provideTestGetMimeType() {
-               return array(
+               return [
                                // Public domain files from https://developers.google.com/speed/webp/gallery2
-                               array( __DIR__ . '/../../data/media/2_webp_a.webp' ),
-                               array( __DIR__ . '/../../data/media/2_webp_ll.webp' ),
-                               array( __DIR__ . '/../../data/media/webp_animated.webp' ),
-               );
+                               [ __DIR__ . '/../../data/media/2_webp_a.webp' ],
+                               [ __DIR__ . '/../../data/media/2_webp_ll.webp' ],
+                               [ __DIR__ . '/../../data/media/webp_animated.webp' ],
+               ];
        }
 }