2 class GIFMetadataExtractorTest
extends MediaWikiTestCase
{
4 protected function setUp() {
7 $this->mediaPath
= __DIR__
. '/../../data/media/';
11 * Put in a file, and see if the metadata coming out is as expected.
12 * @param $filename String
13 * @param $expected Array The extracted metadata.
14 * @dataProvider provideGetMetadata
16 public function testGetMetadata( $filename, $expected ) {
17 $actual = GIFMetadataExtractor
::getMetadata( $this->mediaPath
. $filename );
18 $this->assertEquals( $expected, $actual );
21 public static function provideGetMetadata() {
24 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
25 <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.30'>
26 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
28 <rdf:Description rdf:about=''
29 xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'>
30 <Iptc4xmpCore:Location>The interwebs</Iptc4xmpCore:Location>
33 <rdf:Description rdf:about=''
34 xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
35 <tiff:Artist>Bawolff</tiff:Artist>
36 <tiff:ImageDescription>
38 <rdf:li xml:lang='x-default'>A file to test GIF</rdf:li>
40 </tiff:ImageDescription>
70 $xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat
76 'comment' => array( 'GIF test file ⁕ Created with GIMP' ),
86 'comment' => array( 'GIF test file . Created with GIMP' ),
101 'comment' => array( 'GIƒ·test·file' ),