Merge "Produce RDF dump of all categories and subcategories in a wiki."
[lhc/web/wiklou.git] / tests / phpunit / includes / media / SVGTest.php
1 <?php
2
3 /**
4 * @group Media
5 */
6 class SvgTest extends MediaWikiMediaTestCase {
7
8 protected function setUp() {
9 parent::setUp();
10
11 $this->filePath = __DIR__ . '/../../data/media/';
12
13 $this->setMwGlobals( 'wgShowEXIF', true );
14
15 $this->handler = new SvgHandler;
16 }
17
18 /**
19 * @param string $filename
20 * @param array $expected The expected independent metadata
21 * @dataProvider providerGetIndependentMetaArray
22 * @covers SvgHandler::getCommonMetaArray
23 */
24 public function testGetIndependentMetaArray( $filename, $expected ) {
25 $file = $this->dataFile( $filename, 'image/svg+xml' );
26 $res = $this->handler->getCommonMetaArray( $file );
27
28 $this->assertEquals( $res, $expected );
29 }
30
31 public static function providerGetIndependentMetaArray() {
32 return [
33 [ 'Tux.svg', [
34 'ObjectName' => 'Tux',
35 'ImageDescription' =>
36 'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
37 ] ],
38 [ 'Wikimedia-logo.svg', [] ]
39 ];
40 }
41 }