6 class GIFMetadataExtractorTest
extends MediaWikiTestCase
{
8 protected function setUp() {
11 $this->mediaPath
= __DIR__
. '/../../data/media/';
15 * Put in a file, and see if the metadata coming out is as expected.
16 * @param string $filename
17 * @param array $expected The extracted metadata.
18 * @dataProvider provideGetMetadata
19 * @covers GIFMetadataExtractor::getMetadata
21 public function testGetMetadata( $filename, $expected ) {
22 $actual = GIFMetadataExtractor
::getMetadata( $this->mediaPath
. $filename );
23 $this->assertEquals( $expected, $actual );
26 public static function provideGetMetadata() {
28 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
29 <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.30'>
30 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
32 <rdf:Description rdf:about=''
33 xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'>
34 <Iptc4xmpCore:Location>The interwebs</Iptc4xmpCore:Location>
37 <rdf:Description rdf:about=''
38 xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
39 <tiff:Artist>Bawolff</tiff:Artist>
40 <tiff:ImageDescription>
42 <rdf:li xml:lang='x-default'>A file to test GIF</rdf:li>
44 </tiff:ImageDescription>
74 $xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat
80 'comment' => [ 'GIF test file ⁕ Created with GIMP' ],
90 'comment' => [ 'GIF test file . Created with GIMP' ],
105 'comment' => [ 'GIƒ·test·file' ],