<?php
/**
+ * @group Media
* @covers Exif
*/
class ExifTest extends MediaWikiTestCase {
protected function setUp() {
parent::setUp();
- if ( !extension_loaded( 'exif' ) ) {
- $this->markTestSkipped( "This test needs the exif extension." );
- }
+ $this->checkPHPExtension( 'exif' );
$this->mediaPath = __DIR__ . '/../../data/media/';
-
-
$this->setMwGlobals( 'wgShowEXIF', true );
}
$seg = JpegMetadataExtractor::segmentSplitter( $filename );
$exif = new Exif( $filename, $seg['byteOrder'] );
$data = $exif->getFilteredData();
- $expected = array(
+ $expected = [
'GPSLatitude' => 88.5180555556,
'GPSLongitude' => -21.12357,
'GPSAltitude' => -3.141592653,
'GPSDOP' => '5/1',
'GPSVersionID' => '2.2.0.0',
- );
+ ];
$this->assertEquals( $expected, $data, '', 0.0000000001 );
}
$exif = new Exif( $filename, $seg['byteOrder'] );
$data = $exif->getFilteredData();
- $expected = array(
- 'UserComment' => 'test⁔comment'
- );
+ $expected = [
+ 'UserComment' => 'test⁔comment',
+ ];
$this->assertEquals( $expected, $data );
}
}