<?php
class ExifTest extends MediaWikiTestCase {
- public function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
$this->mediaPath = __DIR__ . '/../../data/media/';
if ( !wfDl( '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->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(
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();