X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FSVGMetadataExtractorTest.php;h=9bfd5f619635321fa08f4eb6d10dd6619c372557;hb=cf539bb31686590ffaa4b06480dbb15b1f272427;hp=ab33d1c22ceb1774e75c579605500be73fd8c443;hpb=b88d4628dcde8babb4990fc4f622673e3f275650;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/media/SVGMetadataExtractorTest.php b/tests/phpunit/includes/media/SVGMetadataExtractorTest.php index ab33d1c22c..9bfd5f6196 100644 --- a/tests/phpunit/includes/media/SVGMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/SVGMetadataExtractorTest.php @@ -6,11 +6,6 @@ */ class SVGMetadataExtractorTest extends MediaWikiTestCase { - protected function setUp() { - parent::setUp(); - AutoLoader::loadClass( 'SVGMetadataExtractorTest' ); - } - /** * @dataProvider provideSvgFiles */ @@ -47,88 +42,88 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase { public static function provideSvgFiles() { $base = __DIR__ . '/../../data/media'; - return array( - array( + return [ + [ "$base/Wikimedia-logo.svg", - array( + [ 'width' => 1024, 'height' => 1024, 'originalWidth' => '1024', 'originalHeight' => '1024', - 'translations' => array(), - ) - ), - array( + 'translations' => [], + ] + ], + [ "$base/QA_icon.svg", - array( + [ 'width' => 60, 'height' => 60, 'originalWidth' => '60', 'originalHeight' => '60', - 'translations' => array(), - ) - ), - array( + 'translations' => [], + ] + ], + [ "$base/Gtk-media-play-ltr.svg", - array( + [ 'width' => 60, 'height' => 60, 'originalWidth' => '60.0000000', 'originalHeight' => '60.0000000', - 'translations' => array(), - ) - ), - array( + 'translations' => [], + ] + ], + [ "$base/Toll_Texas_1.svg", - // This file triggered bug 31719, needs entity expansion in the xmlns checks - array( + // This file triggered T33719, needs entity expansion in the xmlns checks + [ 'width' => 385, 'height' => 385, 'originalWidth' => '385', 'originalHeight' => '385.0004883', - 'translations' => array(), - ) - ), - array( + 'translations' => [], + ] + ], + [ "$base/Tux.svg", - array( + [ 'width' => 512, 'height' => 594, 'originalWidth' => '100%', 'originalHeight' => '100%', 'title' => 'Tux', - 'translations' => array(), + 'translations' => [], 'description' => 'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg', - ) - ), - array( + ] + ], + [ "$base/Speech_bubbles.svg", - array( + [ 'width' => 627, 'height' => 461, 'originalWidth' => '17.7cm', 'originalHeight' => '13cm', - 'translations' => array( + 'translations' => [ 'de' => SVGReader::LANG_FULL_MATCH, 'fr' => SVGReader::LANG_FULL_MATCH, 'nl' => SVGReader::LANG_FULL_MATCH, 'tlh-ca' => SVGReader::LANG_FULL_MATCH, 'tlh' => SVGReader::LANG_PREFIX_MATCH - ), - ) - ), - array( + ], + ] + ], + [ "$base/Soccer_ball_animated.svg", - array( + [ 'width' => 150, 'height' => 150, 'originalWidth' => '150', 'originalHeight' => '150', 'animated' => true, - 'translations' => array() - ), - ), - ); + 'translations' => [] + ], + ], + ]; } public static function provideSvgFilesWithXMLMetadata() { @@ -143,18 +138,18 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase { // @codingStandardsIgnoreEnd $metadata = str_replace( "\r", '', $metadata ); // Windows compat - return array( - array( + return [ + [ "$base/US_states_by_total_state_tax_revenue.svg", - array( + [ 'height' => 593, 'metadata' => $metadata, 'width' => 959, 'originalWidth' => '958.69', 'originalHeight' => '592.78998', - 'translations' => array(), - ) - ), - ); + 'translations' => [], + ] + ], + ]; } }