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