X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fmedia%2FGIFTest.php;h=6dbce7fd568545950a16755a50ceba6c165475d7;hb=966fb8da62a9439476ada380dfc3c1a2672446ec;hp=c8e729c80904372b996d2fa5317b4bf1ccd3cb86;hpb=d4b250ad380b024620b724c9f9485e79ea712798;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/media/GIFTest.php b/tests/phpunit/includes/media/GIFTest.php index c8e729c809..6dbce7fd56 100644 --- a/tests/phpunit/includes/media/GIFTest.php +++ b/tests/phpunit/includes/media/GIFTest.php @@ -113,6 +113,41 @@ class GIFHandlerTest extends MediaWikiTestCase { ); } + /** + * @param $filename String + * @param $expected String Serialized array + * @dataProvider provideGetIndependentMetaArray + */ + public function testGetIndependentMetaArray( $filename, $expected ) { + $file = $this->dataFile( $filename, 'image/gif' ); + $actual = $this->handler->getCommonMetaArray( $file ); + $this->assertEquals( $expected, $actual ); + } + + public function provideGetIndependentMetaArray() { + return array( + array( 'nonanimated.gif', array( + 'GIFFileComment' => array( + 'GIF test file ⁕ Created with GIMP', + ), + ) ), + array( 'animated-xmp.gif', + array( + 'Artist' => 'Bawolff', + 'ImageDescription' => array( + 'x-default' => 'A file to test GIF', + '_type' => 'lang', + ), + 'SublocationDest' => 'The interwebs', + 'GIFFileComment' => + array( + 'GIƒ·test·file', + ), + ) + ), + ); + } + private function dataFile( $name, $type ) { return new UnregisteredLocalFile( false, $this->repo, "mwstore://localtesting/data/$name", $type );