X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FPNGTest.php;h=afc338e13c5162b89a363abb0b4dc7c3f82a7a5e;hb=816e6ded007382f35df38ea8f4b5a32e8e256b78;hp=5f1f6caec92021f4a4921749b15d9ed3c578775f;hpb=c14fcf8015fdfb22e8717f2f7135eea5f2a943d3;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/media/PNGTest.php b/tests/phpunit/includes/media/PNGTest.php index 5f1f6caec9..afc338e13c 100644 --- a/tests/phpunit/includes/media/PNGTest.php +++ b/tests/phpunit/includes/media/PNGTest.php @@ -34,10 +34,10 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } public static function provideIsAnimated() { - return array( - array( 'Animated_PNG_example_bouncing_beach_ball.png', true ), - array( '1bit-png.png', false ), - ); + return [ + [ 'Animated_PNG_example_bouncing_beach_ball.png', true ], + [ '1bit-png.png', false ], + ]; } /** @@ -53,12 +53,12 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } public static function provideGetImageArea() { - return array( - array( '1bit-png.png', 2500 ), - array( 'greyscale-png.png', 2500 ), - array( 'Png-native-test.png', 126000 ), - array( 'Animated_PNG_example_bouncing_beach_ball.png', 10000 ), - ); + return [ + [ '1bit-png.png', 2500 ], + [ 'greyscale-png.png', 2500 ], + [ 'Png-native-test.png', 126000 ], + [ 'Animated_PNG_example_bouncing_beach_ball.png', 10000 ], + ]; } /** @@ -73,15 +73,18 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } public static function provideIsMetadataValid() { - return array( - array( PNGHandler::BROKEN_FILE, PNGHandler::METADATA_GOOD ), - array( '', PNGHandler::METADATA_BAD ), - array( null, PNGHandler::METADATA_BAD ), - array( 'Something invalid!', PNGHandler::METADATA_BAD ), + return [ + [ PNGHandler::BROKEN_FILE, PNGHandler::METADATA_GOOD ], + [ '', PNGHandler::METADATA_BAD ], + [ null, PNGHandler::METADATA_BAD ], + [ 'Something invalid!', PNGHandler::METADATA_BAD ], // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong - array( 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}', PNGHandler::METADATA_GOOD ), + [ + 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}', + PNGHandler::METADATA_GOOD + ], // @codingStandardsIgnoreEnd - ); + ]; } /** @@ -98,12 +101,18 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } public static function provideGetMetadata() { - return array( + return [ // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong - array( 'rgb-na-png.png', 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}' ), - array( 'xmp.png', 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:1;s:9:"colorType";s:14:"index-coloured";s:8:"metadata";a:2:{s:12:"SerialNumber";s:9:"123456789";s:15:"_MW_PNG_VERSION";i:1;}}' ), + [ + 'rgb-na-png.png', + 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}' + ], + [ + 'xmp.png', + 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:1;s:9:"colorType";s:14:"index-coloured";s:8:"metadata";a:2:{s:12:"SerialNumber";s:9:"123456789";s:15:"_MW_PNG_VERSION";i:1;}}' + ], // @codingStandardsIgnoreEnd - ); + ]; } /** @@ -119,14 +128,14 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } public static function provideGetIndependentMetaArray() { - return array( - array( 'rgb-na-png.png', array() ), - array( 'xmp.png', - array( + return [ + [ 'rgb-na-png.png', [] ], + [ 'xmp.png', + [ 'SerialNumber' => '123456789', - ) - ), - ); + ] + ], + ]; } /** @@ -141,11 +150,11 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } public function provideGetLength() { - return array( - array( 'Animated_PNG_example_bouncing_beach_ball.png', 1.5 ), - array( 'Png-native-test.png', 0.0 ), - array( 'greyscale-png.png', 0.0 ), - array( '1bit-png.png', 0.0 ), - ); + return [ + [ 'Animated_PNG_example_bouncing_beach_ball.png', 1.5 ], + [ 'Png-native-test.png', 0.0 ], + [ 'greyscale-png.png', 0.0 ], + [ '1bit-png.png', 0.0 ], + ]; } }