From: Platonides Date: Wed, 20 Jul 2011 15:24:21 +0000 (+0000) Subject: I like better checking for the actual extension, loading if needed (and able). X-Git-Tag: 1.31.0-rc.0~28722 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=3d6ed9a69a13720fbcabc22c8b95c1a62f4af7ac;p=lhc%2Fweb%2Fwiklou.git I like better checking for the actual extension, loading if needed (and able). --- 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;