summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'tests/phpunit/includes/media/BitmapMetadataHandlerTest.php')
-rw-r--r--tests/phpunit/includes/media/BitmapMetadataHandlerTest.php26
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
index a0d5cd86..f4f52dd8 100644
--- a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
+++ b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
@@ -14,10 +14,15 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase {
* translation (to en) where XMP should win.
*/
public function testMultilingualCascade() {
- global $wgShowEXIF;
- if ( !$wgShowEXIF ) {
- $this->markTestIncomplete( "This test needs the exif extension." );
+ if ( !wfDl( 'exif' ) ) {
+ $this->markTestSkipped( "This test needs the exif extension." );
+ }
+ if ( !wfDl( 'xml' ) ) {
+ $this->markTestSkipped( "This test needs the xml extension." );
}
+ global $wgShowEXIF;
+ $oldExif = $wgShowEXIF;
+ $wgShowEXIF = true;
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .
'/Xmp-exif-multilingual_test.jpg' );
@@ -32,6 +37,8 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase {
'Did not extract any ImageDescription info?!' );
$this->assertEquals( $expected, $meta['ImageDescription'] );
+
+ $wgShowEXIF = $oldExif;
}
/**
@@ -49,6 +56,16 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase {
$meta['JPEGFileComment'][0] );
}
+ /**
+ * Make sure a bad iptc block doesn't stop the other metadata
+ * from being extracted.
+ */
+ public function testBadIPTC() {
+ $meta = BitmapMetadataHandler::Jpeg( $this->filePath .
+ 'iptc-invalid-psir.jpg' );
+ $this->assertEquals( 'Created with GIMP', $meta['JPEGFileComment'][0] );
+ }
+
public function testIPTCDates() {
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .
'iptc-timetest.jpg' );
@@ -95,6 +112,9 @@ class BitmapMetadataHandlerTest extends MediaWikiTestCase {
}
public function testPNGXMP() {
+ if ( !wfDl( 'xml' ) ) {
+ $this->markTestSkipped( "This test needs the xml extension." );
+ }
$handler = new BitmapMetadataHandler();
$result = $handler->png( $this->filePath . 'xmp.png' );
$expected = array (