summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/media/PNGMetadataExtractorTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/media/PNGMetadataExtractorTest.php')
-rw-r--r--tests/phpunit/includes/media/PNGMetadataExtractorTest.php32
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php b/tests/phpunit/includes/media/PNGMetadataExtractorTest.php
index 1e912017..939f2cfc 100644
--- a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php
+++ b/tests/phpunit/includes/media/PNGMetadataExtractorTest.php
@@ -1,4 +1,8 @@
<?php
+
+/**
+ * @todo covers tags
+ */
class PNGMetadataExtractorTest extends MediaWikiTestCase {
protected function setUp() {
@@ -9,7 +13,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
/**
* Tests zTXt tag (compressed textual metadata)
*/
- function testPngNativetZtxt() {
+ public function testPngNativetZtxt() {
$this->checkPHPExtension( 'zlib' );
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
@@ -26,7 +30,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
/**
* Test tEXt tag (Uncompressed textual metadata)
*/
- function testPngNativeText() {
+ public function testPngNativeText() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
$expected = "Some long image desc";
@@ -43,7 +47,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
* tEXt tags must be encoded iso-8859-1 (vs iTXt which are utf-8)
* Make sure non-ascii characters get converted properly
*/
- function testPngNativeTextNonAscii() {
+ public function testPngNativeTextNonAscii() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
@@ -52,7 +56,6 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
// encoded as just \xA9.
$expected = "© 2010 Bawolff";
-
$this->assertArrayHasKey( 'text', $meta );
$meta = $meta['text'];
$this->assertArrayHasKey( 'Copyright', $meta );
@@ -66,7 +69,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
* actual resolution of the image is (aka in dots per meter).
*/
/*
- function testPngPhysTag () {
+ public function testPngPhysTag() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
@@ -82,7 +85,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
/**
* Given a normal static PNG, check the animation metadata returned.
*/
- function testStaticPngAnimationMetadata() {
+ public function testStaticPngAnimationMetadata() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
@@ -95,7 +98,7 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
* Given an animated APNG image file
* check it gets animated metadata right.
*/
- function testApngAnimationMetadata() {
+ public function testApngAnimationMetadata() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Animated_PNG_example_bouncing_beach_ball.png' );
@@ -105,49 +108,48 @@ class PNGMetadataExtractorTest extends MediaWikiTestCase {
$this->assertEquals( 1.5, $meta['duration'], '', 0.00001 );
}
- function testPngBitDepth8() {
+ public function testPngBitDepth8() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
$this->assertEquals( 8, $meta['bitDepth'] );
}
- function testPngBitDepth1() {
+ public function testPngBitDepth1() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'1bit-png.png' );
$this->assertEquals( 1, $meta['bitDepth'] );
}
- function testPngIndexColour() {
+ public function testPngIndexColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
$this->assertEquals( 'index-coloured', $meta['colorType'] );
}
- function testPngRgbColour() {
+ public function testPngRgbColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'rgb-png.png' );
$this->assertEquals( 'truecolour-alpha', $meta['colorType'] );
}
- function testPngRgbNoAlphaColour() {
+ public function testPngRgbNoAlphaColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'rgb-na-png.png' );
$this->assertEquals( 'truecolour', $meta['colorType'] );
}
- function testPngGreyscaleColour() {
+ public function testPngGreyscaleColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'greyscale-png.png' );
$this->assertEquals( 'greyscale-alpha', $meta['colorType'] );
}
- function testPngGreyscaleNoAlphaColour() {
+ public function testPngGreyscaleNoAlphaColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'greyscale-na-png.png' );
$this->assertEquals( 'greyscale', $meta['colorType'] );
}
-
}