MediaWiki  1.23.12
GIFMetadataExtractorTest.php
Go to the documentation of this file.
1 <?php
2 class GIFMetadataExtractorTest extends MediaWikiTestCase {
3 
4  protected function setUp() {
5  parent::setUp();
6 
7  $this->mediaPath = __DIR__ . '/../../data/media/';
8  }
9 
17  public function testGetMetadata( $filename, $expected ) {
18  $actual = GIFMetadataExtractor::getMetadata( $this->mediaPath . $filename );
19  $this->assertEquals( $expected, $actual );
20  }
21 
22  public static function provideGetMetadata() {
23 
24  $xmpNugget = <<<EOF
25 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
26 <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.30'>
27 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
28 
29  <rdf:Description rdf:about=''
30  xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'>
31  <Iptc4xmpCore:Location>The interwebs</Iptc4xmpCore:Location>
32  </rdf:Description>
33 
34  <rdf:Description rdf:about=''
35  xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
36  <tiff:Artist>Bawolff</tiff:Artist>
37  <tiff:ImageDescription>
38  <rdf:Alt>
39  <rdf:li xml:lang='x-default'>A file to test GIF</rdf:li>
40  </rdf:Alt>
41  </tiff:ImageDescription>
42  </rdf:Description>
43 </rdf:RDF>
44 </x:xmpmeta>
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 <?xpacket end='w'?>
70 EOF;
71  $xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat
72 
73  return array(
74  array(
75  'nonanimated.gif',
76  array(
77  'comment' => array( 'GIF test file ⁕ Created with GIMP' ),
78  'duration' => 0.1,
79  'frameCount' => 1,
80  'looped' => false,
81  'xmp' => '',
82  )
83  ),
84  array(
85  'animated.gif',
86  array(
87  'comment' => array( 'GIF test file . Created with GIMP' ),
88  'duration' => 2.4,
89  'frameCount' => 4,
90  'looped' => true,
91  'xmp' => '',
92  )
93  ),
94 
95  array(
96  'animated-xmp.gif',
97  array(
98  'xmp' => $xmpNugget,
99  'duration' => 2.4,
100  'frameCount' => 4,
101  'looped' => true,
102  'comment' => array( 'GIƒ·test·file' ),
103  )
104  ),
105  );
106  }
107 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
file
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
Definition: hooks.txt:93
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
GIFMetadataExtractor\getMetadata
static getMetadata( $filename)
Definition: GIFMetadataExtractor.php:56
begin
$dbw begin(__METHOD__)
MediaWikiTestCase\setUp
setUp()
Definition: MediaWikiTestCase.php:187