diff options
Diffstat (limited to 'tests/phpunit/includes/media/ExifTest.php')
-rw-r--r-- | tests/phpunit/includes/media/ExifTest.php | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/phpunit/includes/media/ExifTest.php b/tests/phpunit/includes/media/ExifTest.php index 045777d7..dea36b03 100644 --- a/tests/phpunit/includes/media/ExifTest.php +++ b/tests/phpunit/includes/media/ExifTest.php @@ -1,25 +1,25 @@ <?php class ExifTest extends MediaWikiTestCase { - public function setUp() { - $this->mediaPath = __DIR__ . '/../../data/media/'; + /** @var string */ + protected $mediaPath; - if ( !wfDl( 'exif' ) ) { + protected function setUp() { + parent::setUp(); + if ( !extension_loaded( 'exif' ) ) { $this->markTestSkipped( "This test needs the exif extension." ); } - global $wgShowEXIF; - $this->showExif = $wgShowEXIF; - $wgShowEXIF = true; - } - public function tearDown() { - global $wgShowEXIF; - $wgShowEXIF = $this->showExif; + $this->mediaPath = __DIR__ . '/../../data/media/'; + + + + $this->setMwGlobals( 'wgShowEXIF', true ); } public function testGPSExtraction() { $filename = $this->mediaPath . 'exif-gps.jpg'; - $seg = JpegMetadataExtractor::segmentSplitter( $filename ); + $seg = JpegMetadataExtractor::segmentSplitter( $filename ); $exif = new Exif( $filename, $seg['byteOrder'] ); $data = $exif->getFilteredData(); $expected = array( @@ -34,7 +34,7 @@ class ExifTest extends MediaWikiTestCase { public function testUnicodeUserComment() { $filename = $this->mediaPath . 'exif-user-comment.jpg'; - $seg = JpegMetadataExtractor::segmentSplitter( $filename ); + $seg = JpegMetadataExtractor::segmentSplitter( $filename ); $exif = new Exif( $filename, $seg['byteOrder'] ); $data = $exif->getFilteredData(); @@ -43,6 +43,4 @@ class ExifTest extends MediaWikiTestCase { ); $this->assertEquals( $expected, $data ); } - - } |