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() {
29 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
30 <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.30'>
31 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
33 <rdf:Description rdf:about=''
34 xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'>
35 <Iptc4xmpCore:Location>The interwebs</Iptc4xmpCore:Location>
38 <rdf:Description rdf:about=''
39 xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
40 <tiff:Artist>Bawolff</tiff:Artist>
41 <tiff:ImageDescription>
43 <rdf:li xml:lang='x-default'>A file to test GIF</rdf:li>
45 </tiff:ImageDescription>
75 $xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat
81 'comment' => [ 'GIF test file ⁕ Created with GIMP' ],
91 'comment' => [ 'GIF test file . Created with GIMP' ],
106 'comment' => [ 'GIƒ·test·file' ],