<?php
+/**
+ * @covers SVGMetadataExtractor
+ */
class SVGMetadataExtractorTest extends MediaWikiTestCase {
protected function setUp() {
/**
* @dataProvider provideSvgFiles
*/
- function testGetMetadata( $infile, $expected ) {
+ public function testGetMetadata( $infile, $expected ) {
$this->assertMetadata( $infile, $expected );
}
/**
* @dataProvider provideSvgFilesWithXMLMetadata
*/
- function testGetXMLMetadata( $infile, $expected ) {
+ public function testGetXMLMetadata( $infile, $expected ) {
$r = new XMLReader();
if ( !method_exists( $r, 'readInnerXML' ) ) {
$this->markTestSkipped( 'XMLReader::readInnerXML() does not exist (libxml >2.6.20 needed).' );
'height' => 1024,
'originalWidth' => '1024',
'originalHeight' => '1024',
+ 'translations' => array(),
)
),
array(
'height' => 60,
'originalWidth' => '60',
'originalHeight' => '60',
+ 'translations' => array(),
)
),
array(
'height' => 60,
'originalWidth' => '60.0000000',
'originalHeight' => '60.0000000',
+ 'translations' => array(),
)
),
array(
'height' => 385,
'originalWidth' => '385',
'originalHeight' => '385.0004883',
+ 'translations' => array(),
)
- )
+ ),
+ array(
+ "$base/Tux.svg",
+ array(
+ 'width' => 512,
+ 'height' => 594,
+ 'originalWidth' => '100%',
+ 'originalHeight' => '100%',
+ 'title' => 'Tux',
+ 'translations' => array(),
+ 'description' => 'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
+ )
+ ),
+ array(
+ "$base/Speech_bubbles.svg",
+ array(
+ 'width' => 627,
+ 'height' => 461,
+ 'originalWidth' => '17.7cm',
+ 'originalHeight' => '13cm',
+ 'translations' => array(
+ 'de' => SVGReader::LANG_FULL_MATCH,
+ 'fr' => SVGReader::LANG_FULL_MATCH,
+ 'nl' => SVGReader::LANG_FULL_MATCH,
+ 'tlh-ca' => SVGReader::LANG_FULL_MATCH,
+ 'tlh' => SVGReader::LANG_PREFIX_MATCH
+ ),
+ )
+ ),
);
}
'width' => 959,
'originalWidth' => '958.69',
'originalHeight' => '592.78998',
+ 'translations' => array(),
)
),
);