Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / media / ExifTest.php
blob735663cf92319e0ed0b3e3a395489e7baaa7a86c
1 <?php
3 /**
4 * @covers Exif
5 */
6 class ExifTest extends MediaWikiTestCase {
8 /** @var string */
9 protected $mediaPath;
11 protected function setUp() {
12 parent::setUp();
13 $this->checkPHPExtension( 'exif' );
15 $this->mediaPath = __DIR__ . '/../../data/media/';
17 $this->setMwGlobals( 'wgShowEXIF', true );
20 public function testGPSExtraction() {
21 $filename = $this->mediaPath . 'exif-gps.jpg';
22 $seg = JpegMetadataExtractor::segmentSplitter( $filename );
23 $exif = new Exif( $filename, $seg['byteOrder'] );
24 $data = $exif->getFilteredData();
25 $expected = array(
26 'GPSLatitude' => 88.5180555556,
27 'GPSLongitude' => -21.12357,
28 'GPSAltitude' => -3.141592653,
29 'GPSDOP' => '5/1',
30 'GPSVersionID' => '2.2.0.0',
32 $this->assertEquals( $expected, $data, '', 0.0000000001 );
35 public function testUnicodeUserComment() {
36 $filename = $this->mediaPath . 'exif-user-comment.jpg';
37 $seg = JpegMetadataExtractor::segmentSplitter( $filename );
38 $exif = new Exif( $filename, $seg['byteOrder'] );
39 $data = $exif->getFilteredData();
41 $expected = array(
42 'UserComment' => 'test⁔comment'
44 $this->assertEquals( $expected, $data );