MediaWiki  1.23.2
SVGTest.php
Go to the documentation of this file.
1 <?php
2 
3 class SvgTest extends MediaWikiTestCase {
4 
5  protected function setUp() {
6  parent::setUp();
7 
8  $this->filePath = __DIR__ . '/../../data/media/';
9 
10  $this->setMwGlobals( 'wgShowEXIF', true );
11 
12  $this->backend = new FSFileBackend( array(
13  'name' => 'localtesting',
14  'wikiId' => wfWikiId(),
15  'containerPaths' => array( 'data' => $this->filePath )
16  ) );
17  $this->repo = new FSRepo( array(
18  'name' => 'temp',
19  'url' => 'http://localhost/thumbtest',
20  'backend' => $this->backend
21  ) );
22 
23  $this->handler = new SvgHandler;
24  }
25 
32  public function testGetIndependentMetaArray( $filename, $expected ) {
33  $file = $this->dataFile( $filename, 'image/svg+xml' );
34  $res = $this->handler->getCommonMetaArray( $file );
35 
36  $this->assertEquals( $res, $expected );
37  }
38 
39  public function providerGetIndependentMetaArray() {
40  return array(
41  array( 'Tux.svg', array(
42  'ObjectName' => 'Tux',
43  'ImageDescription' => 'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
44  ) ),
45  array( 'Wikimedia-logo.svg', array() )
46  );
47  }
48 
49  private function dataFile( $name, $type ) {
50  return new UnregisteredLocalFile( false, $this->repo,
51  "mwstore://localtesting/data/$name", $type );
52  }
53 }
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
SvgTest\dataFile
dataFile( $name, $type)
Definition: SVGTest.php:49
FSRepo
A repository for files accessible via the local filesystem.
Definition: FSRepo.php:33
UnregisteredLocalFile
A file object referring to either a standalone local file, or a file in a local repository with no da...
Definition: UnregisteredLocalFile.php:36
SvgTest\providerGetIndependentMetaArray
providerGetIndependentMetaArray()
Definition: SVGTest.php:39
SvgTest\setUp
setUp()
Definition: SVGTest.php:5
SvgTest
Definition: SVGTest.php:3
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Definition: MediaWikiTestCase.php:302
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
SvgHandler
Handler for SVG images.
Definition: SVG.php:29
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
SvgTest\testGetIndependentMetaArray
testGetIndependentMetaArray( $filename, $expected)
Definition: SVGTest.php:32
FSFileBackend
Class for a file system (FS) based file backend.
Definition: FSFileBackend.php:41
$res
$res
Definition: database.txt:21
$type
$type
Definition: testCompression.php:46