Follows-upb36d883. By far most data providers are static (and PHPUnit expects them to be static and calls them that way). Most of these classes already had their data providers static but additional commits sloppily introduced non-static ones. * ResourceLoaderWikiModuleTest,8968d8787f. * TitleTest,545f1d3a73. Odd unused method 'dataTestIsValidMoveOperation' was introduced in550b878e63. * GlobalVarConfigTest,a3e18c3670. Change-Id: I5da99f7cd3da68c550ae507ffe1f725d31e7666f
41 lines
987 B
PHP
41 lines
987 B
PHP
<?php
|
|
|
|
/**
|
|
* @group Media
|
|
*/
|
|
class SvgTest extends MediaWikiMediaTestCase {
|
|
|
|
protected function setUp() {
|
|
parent::setUp();
|
|
|
|
$this->filePath = __DIR__ . '/../../data/media/';
|
|
|
|
$this->setMwGlobals( 'wgShowEXIF', true );
|
|
|
|
$this->handler = new SvgHandler;
|
|
}
|
|
|
|
/**
|
|
* @param string $filename
|
|
* @param array $expected The expected independent metadata
|
|
* @dataProvider providerGetIndependentMetaArray
|
|
* @covers SvgHandler::getCommonMetaArray
|
|
*/
|
|
public function testGetIndependentMetaArray( $filename, $expected ) {
|
|
$file = $this->dataFile( $filename, 'image/svg+xml' );
|
|
$res = $this->handler->getCommonMetaArray( $file );
|
|
|
|
$this->assertEquals( $res, $expected );
|
|
}
|
|
|
|
public static function providerGetIndependentMetaArray() {
|
|
return array(
|
|
array( 'Tux.svg', array(
|
|
'ObjectName' => 'Tux',
|
|
'ImageDescription' =>
|
|
'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
|
|
) ),
|
|
array( 'Wikimedia-logo.svg', array() )
|
|
);
|
|
}
|
|
}
|