merged master
[lhc/web/wiklou.git] / tests / phpunit / includes / media / ExifTest.php
index 9b490e9..045777d 100644 (file)
@@ -2,22 +2,22 @@
 class ExifTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->mediaPath = dirname( __FILE__ ) . '/../../data/media/';
+               $this->mediaPath = __DIR__ . '/../../data/media/';
 
-                global $wgShowEXIF;
-                $this->showExif = $wgShowEXIF;
-                $wgShowEXIF = true;
-       }
-        public function tearDown() {
-                global $wgShowEXIF;
-                $wgShowEXIF = $this->showExif;
-        }
-
-       public function testGPSExtraction() {
                if ( !wfDl( 'exif' ) ) {
-                       $this->markTestIncomplete( "This test needs the exif extension." );
+                       $this->markTestSkipped( "This test needs the exif extension." );
                }
+               global $wgShowEXIF;
+               $this->showExif = $wgShowEXIF;
+               $wgShowEXIF = true;
+       }
+
+       public function tearDown() {
+               global $wgShowEXIF;
+               $wgShowEXIF = $this->showExif;
+       }
 
+       public function testGPSExtraction() {
                $filename = $this->mediaPath . 'exif-gps.jpg';
                $seg = JpegMetadataExtractor::segmentSplitter( $filename ); 
                $exif = new Exif( $filename, $seg['byteOrder'] );
@@ -25,17 +25,14 @@ class ExifTest extends MediaWikiTestCase {
                $expected = array(
                        'GPSLatitude' => 88.5180555556,
                        'GPSLongitude' => -21.12357,
-                       'GPSAltitude' => -200,
+                       'GPSAltitude' => -3.141592653,
                        'GPSDOP' => '5/1',
                        'GPSVersionID' => '2.2.0.0',
                );
                $this->assertEquals( $expected, $data, '', 0.0000000001 );
        }
-       public function testUnicodeUserComment() {
-               if ( !wfDl( 'exif' ) ) {
-                       $this->markTestIncomplete( "This test needs the exif extension." );
-               }
 
+       public function testUnicodeUserComment() {
                $filename = $this->mediaPath . 'exif-user-comment.jpg';
                $seg = JpegMetadataExtractor::segmentSplitter( $filename ); 
                $exif = new Exif( $filename, $seg['byteOrder'] );