MediaWiki REL1_30
SVGTest.php
Go to the documentation of this file.
1<?php
2
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
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}
Specificly for testing Media handlers.
dataFile( $name, $type=null)
Utility function: Get a new file object for a file on disk but not actually in db.
setMwGlobals( $pairs, $value=null)
Sets a global, maintaining a stashed version of the previous global to be restored in tearDown.
Handler for SVG images.
Definition SVG.php:30
Media.
Definition SVGTest.php:6
testGetIndependentMetaArray( $filename, $expected)
Definition SVGTest.php:24
static providerGetIndependentMetaArray()
Definition SVGTest.php:31
setUp()
Definition SVGTest.php:8
$res
Definition database.txt:21
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves set to a MediaTransformOutput the error message to be returned in an array you should do so by altering $wgNamespaceProtection and $wgNamespaceContentModels outside the handler
Definition hooks.txt:928