X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2Fpage%2FImagePageTest.php;h=8e49bf9865d75cc790a497109f13e985bbaaa0e3;hb=a620ccb99ce905d8d8afd51fce2bdb7647cad958;hp=3c255b5f669a3a825193bc3329fd8733cd64884f;hpb=8c087b9fd13d9302ec1be2176ef1ae344b3f8273;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/page/ImagePageTest.php b/tests/phpunit/includes/page/ImagePageTest.php index 3c255b5f66..8e49bf9865 100644 --- a/tests/phpunit/includes/page/ImagePageTest.php +++ b/tests/phpunit/includes/page/ImagePageTest.php @@ -2,13 +2,13 @@ class ImagePageTest extends MediaWikiMediaTestCase { function setUp() { - $this->setMwGlobals( 'wgImageLimits', array( - array( 320, 240 ), - array( 640, 480 ), - array( 800, 600 ), - array( 1024, 768 ), - array( 1280, 1024 ) - ) ); + $this->setMwGlobals( 'wgImageLimits', [ + [ 320, 240 ], + [ 640, 480 ], + [ 800, 600 ], + [ 1024, 768 ], + [ 1280, 1024 ] + ] ); parent::setUp(); } @@ -21,6 +21,7 @@ class ImagePageTest extends MediaWikiMediaTestCase { } /** + * @covers ImagePage::getDisplayWidthHeight * @dataProvider providerGetDisplayWidthHeight * @param array $dim Array [maxWidth, maxHeight, width, height] * @param array $expected Array [width, height] The width and height we expect to display at @@ -36,35 +37,36 @@ class ImagePageTest extends MediaWikiMediaTestCase { } function providerGetDisplayWidthHeight() { - return array( - array( - array( 1024.0, 768.0, 600.0, 600.0 ), - array( 600.0, 600.0 ) - ), - array( - array( 1024.0, 768.0, 1600.0, 600.0 ), - array( 1024.0, 384.0 ) - ), - array( - array( 1024.0, 768.0, 1024.0, 768.0 ), - array( 1024.0, 768.0 ) - ), - array( - array( 1024.0, 768.0, 800.0, 1000.0 ), - array( 614.0, 768.0 ) - ), - array( - array( 1024.0, 768.0, 0, 1000 ), - array( 0, 0 ) - ), - array( - array( 1024.0, 768.0, 2000, 0 ), - array( 0, 0 ) - ), - ); + return [ + [ + [ 1024.0, 768.0, 600.0, 600.0 ], + [ 600.0, 600.0 ] + ], + [ + [ 1024.0, 768.0, 1600.0, 600.0 ], + [ 1024.0, 384.0 ] + ], + [ + [ 1024.0, 768.0, 1024.0, 768.0 ], + [ 1024.0, 768.0 ] + ], + [ + [ 1024.0, 768.0, 800.0, 1000.0 ], + [ 614.0, 768.0 ] + ], + [ + [ 1024.0, 768.0, 0, 1000 ], + [ 0, 0 ] + ], + [ + [ 1024.0, 768.0, 2000, 0 ], + [ 0, 0 ] + ], + ]; } /** + * @covers ImagePage::getThumbSizes * @dataProvider providerGetThumbSizes * @param string $filename * @param int $expectedNumberThumbs How many thumbnails to show @@ -80,11 +82,11 @@ class ImagePageTest extends MediaWikiMediaTestCase { } function providerGetThumbSizes() { - return array( - array( 'animated.gif', 2 ), - array( 'Toll_Texas_1.svg', 1 ), - array( '80x60-Greyscale.xcf', 1 ), - array( 'jpeg-comment-binary.jpg', 2 ), - ); + return [ + [ 'animated.gif', 2 ], + [ 'Toll_Texas_1.svg', 1 ], + [ '80x60-Greyscale.xcf', 1 ], + [ 'jpeg-comment-binary.jpg', 2 ], + ]; } }