Merge "Add input checks for Language::sprintfDate()"
[lhc/web/wiklou.git] / tests / phpunit / includes / media / PNGMetadataExtractorTest.php
index e027668..58d791f 100644 (file)
@@ -5,10 +5,13 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
                parent::setUp();
                $this->filePath = __DIR__ . '/../../data/media/';
        }
+
        /**
-        * Tests zTXt tag (compressed textual metadata) 
+        * Tests zTXt tag (compressed textual metadata)
         */
        function testPngNativetZtxt() {
+               $this->checkPHPExtension( 'zlib' );
+
                $meta = PNGMetadataExtractor::getMetadata( $this->filePath .
                        'Png-native-test.png' );
                $expected = "foo bar baz foo foo foo foof foo foo foo foo";
@@ -49,7 +52,6 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
                // encoded as just \xA9.
                $expected = "© 2010 Bawolff";
 
-
                $this->assertArrayHasKey( 'text', $meta );
                $meta = $meta['text'];
                $this->assertArrayHasKey( 'Copyright', $meta );
@@ -62,8 +64,8 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
         * Test extraction of pHYs tags, which can tell what the
         * actual resolution of the image is (aka in dots per meter).
         */
-/*
-       function testPngPhysTag () {
+       /*
+       function testPngPhysTag() {
                $meta = PNGMetadataExtractor::getMetadata( $this->filePath .
                        'Png-native-test.png' );
 
@@ -74,7 +76,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
                $this->assertEquals( '2835/100', $meta['YResolution'] );
                $this->assertEquals( 3, $meta['ResolutionUnit'] ); // 3 = cm
        }
-*/
+       */
 
        /**
         * Given a normal static PNG, check the animation metadata returned.
@@ -108,6 +110,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
 
                $this->assertEquals( 8, $meta['bitDepth'] );
        }
+
        function testPngBitDepth1() {
                $meta = PNGMetadataExtractor::getMetadata( $this->filePath .
                        '1bit-png.png' );
@@ -121,25 +124,28 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
 
                $this->assertEquals( 'index-coloured', $meta['colorType'] );
        }
+
        function testPngRgbColour() {
                $meta = PNGMetadataExtractor::getMetadata( $this->filePath .
                        'rgb-png.png' );
                $this->assertEquals( 'truecolour-alpha', $meta['colorType'] );
        }
+
        function testPngRgbNoAlphaColour() {
                $meta = PNGMetadataExtractor::getMetadata( $this->filePath .
                        'rgb-na-png.png' );
                $this->assertEquals( 'truecolour', $meta['colorType'] );
        }
+
        function testPngGreyscaleColour() {
                $meta = PNGMetadataExtractor::getMetadata( $this->filePath .
                        'greyscale-png.png' );
                $this->assertEquals( 'greyscale-alpha', $meta['colorType'] );
        }
+
        function testPngGreyscaleNoAlphaColour() {
                $meta = PNGMetadataExtractor::getMetadata( $this->filePath .
                        'greyscale-na-png.png' );
                $this->assertEquals( 'greyscale', $meta['colorType'] );
        }
-
 }