Extract list of languages svg is translated into.
[lhc/web/wiklou.git] / tests / phpunit / includes / media / SVGMetadataExtractorTest.php
index 3bf9c59..ec7b0c9 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+/**
+ * @covers SVGMetadataExtractor
+ */
 class SVGMetadataExtractorTest extends MediaWikiTestCase {
 
        protected function setUp() {
@@ -10,14 +13,14 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
        /**
         * @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).' );
@@ -51,6 +54,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
                                        'height' => 1024,
                                        'originalWidth' => '1024',
                                        'originalHeight' => '1024',
+                                       'translations' => array(),
                                )
                        ),
                        array(
@@ -60,6 +64,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
                                        'height' => 60,
                                        'originalWidth' => '60',
                                        'originalHeight' => '60',
+                                       'translations' => array(),
                                )
                        ),
                        array(
@@ -69,6 +74,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
                                        'height' => 60,
                                        'originalWidth' => '60.0000000',
                                        'originalHeight' => '60.0000000',
+                                       'translations' => array(),
                                )
                        ),
                        array(
@@ -79,8 +85,37 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
                                        '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
+                                       ),
+                               )
+                       ),
                );
        }
 
@@ -102,6 +137,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
                                        'width' => 959,
                                        'originalWidth' => '958.69',
                                        'originalHeight' => '592.78998',
+                                       'translations' => array(),
                                )
                        ),
                );