Merge "FormatJson: Remove whitespace from empty arrays and objects"
[lhc/web/wiklou.git] / tests / phpunit / includes / media / JpegTest.php
index ea007f9..ce956ba 100644 (file)
@@ -1,18 +1,21 @@
 <?php
+/**
+ * @covers JpegHandler
+ */
 class JpegTest extends MediaWikiTestCase {
 
-       public function setUp() {
-               $this->filePath = __DIR__ . '/../../data/media/';
-               if ( !wfDl( 'exif' ) ) {
+       protected $filePath;
+
+       protected function setUp() {
+               parent::setUp();
+               if ( !extension_loaded( '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->filePath = __DIR__ . '/../../data/media/';
+
+
+               $this->setMwGlobals( 'wgShowEXIF', true );
        }
 
        public function testInvalidFile() {
@@ -20,6 +23,7 @@ class JpegTest extends MediaWikiTestCase {
                $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' );