<?php
class JpegTest extends MediaWikiTestCase {
- public function setUp() {
- $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+ protected function setUp() {
+ parent::setUp();
+
+ $this->filePath = __DIR__ . '/../../data/media/';
if ( !wfDl( 'exif' ) ) {
$this->markTestSkipped( "This test needs the exif extension." );
}
- global $wgShowEXIF;
- $this->show = $wgShowEXIF;
- $wgShowEXIF = true;
- }
- public function tearDown() {
- global $wgShowEXIF;
- $wgShowEXIF = $this->show;
+
+ $this->setMwGlobals( 'wgShowEXIF', true );
}
public function testInvalidFile() {
$res = $jpeg->getMetadata( null, $this->filePath . 'README' );
$this->assertEquals( ExifBitmapHandler::BROKEN_FILE, $res );
}
+
public function testJpegMetadataExtraction() {
$h = new JpegHandler;
$res = $h->getMetadata( null, $this->filePath . 'test.jpg' );