From 3d6ed9a69a13720fbcabc22c8b95c1a62f4af7ac Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 20 Jul 2011 15:24:21 +0000 Subject: [PATCH] I like better checking for the actual extension, loading if needed (and able). --- .../phpunit/includes/media/ExifBitmapTest.php | 19 +++++++------------ tests/phpunit/includes/media/JpegTest.php | 8 ++++---- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/tests/phpunit/includes/media/ExifBitmapTest.php b/tests/phpunit/includes/media/ExifBitmapTest.php index f8b37172d3..3c6c46a930 100644 --- a/tests/phpunit/includes/media/ExifBitmapTest.php +++ b/tests/phpunit/includes/media/ExifBitmapTest.php @@ -1,9 +1,9 @@ markTestIncomplete( "This test needs the exif extension." ); } $handler = new ExifBitmapHandler; @@ -11,8 +11,7 @@ class ExifBitmapTest extends MediaWikiTestCase { $this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res ); } public function testIsBrokenFile() { - global $wgShowEXIF; - if ( !$wgShowEXIF ) { + if ( !wfDl( 'exif' ) ) { $this->markTestIncomplete( "This test needs the exif extension." ); } $handler = new ExifBitmapHandler; @@ -20,8 +19,7 @@ class ExifBitmapTest extends MediaWikiTestCase { $this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res ); } public function testIsInvalid() { - global $wgShowEXIF; - if ( !$wgShowEXIF ) { + if ( !wfDl( 'exif' ) ) { $this->markTestIncomplete( "This test needs the exif extension." ); } $handler = new ExifBitmapHandler; @@ -29,8 +27,7 @@ class ExifBitmapTest extends MediaWikiTestCase { $this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res ); } public function testGoodMetadata() { - global $wgShowEXIF; - if ( !$wgShowEXIF ) { + if ( !wfDl( 'exif' ) ) { $this->markTestIncomplete( "This test needs the exif extension." ); } $handler = new ExifBitmapHandler; @@ -39,8 +36,7 @@ class ExifBitmapTest extends MediaWikiTestCase { $this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res ); } public function testIsOldGood() { - global $wgShowEXIF; - if ( !$wgShowEXIF ) { + if ( !wfDl( 'exif' ) ) { $this->markTestIncomplete( "This test needs the exif extension." ); } $handler = new ExifBitmapHandler; @@ -51,8 +47,7 @@ class ExifBitmapTest extends MediaWikiTestCase { // Handle metadata from paged tiff handler (gotten via instant commons) // gracefully. public function testPagedTiffHandledGracefully() { - global $wgShowEXIF; - if ( !$wgShowEXIF ) { + if ( !wfDl( 'exif' ) ) { $this->markTestIncomplete( "This test needs the exif extension." ); } $handler = new ExifBitmapHandler; diff --git a/tests/phpunit/includes/media/JpegTest.php b/tests/phpunit/includes/media/JpegTest.php index cc2e556157..da02fe5cfe 100644 --- a/tests/phpunit/includes/media/JpegTest.php +++ b/tests/phpunit/includes/media/JpegTest.php @@ -1,9 +1,10 @@ markTestIncomplete( "This test needs the exif extension." ); } $jpeg = new JpegHandler; @@ -11,8 +12,7 @@ class JpegTest extends MediaWikiTestCase { $this->assertEquals( ExifBitmapHandler::BROKEN_FILE, $res ); } public function testTiffFile() { - global $wgShowEXIF; - if ( !$wgShowEXIF ) { + if ( !wfDl( 'exif' ) ) { $this->markTestIncomplete( "This test needs the exif extension." ); } $h = new JpegHandler; -- 2.20.1