Skip to content

Commit 49b5278

Browse files
author
Marek Szymczuk
committed
Updated unit tests for GPS
1 parent d022abe commit 49b5278

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tests/PHPExif/Mapper/NativeMapperTest.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,25 @@ public function testMapRawDataFlattensRawDataWithSections()
175175
*/
176176
public function testMapRawDataCorrectlyFormatsGPSData()
177177
{
178-
$result = $this->mapper->mapRawData(
179-
array(
178+
$expected = array(
179+
'40.333452380952,-20.167314814815' => array(
180180
'GPSLatitude' => array('40/1', '20/1', '15/35'),
181181
'GPSLatitudeRef' => 'N',
182182
'GPSLongitude' => array('20/1', '10/1', '35/15'),
183183
'GPSLongitudeRef' => 'W',
184-
)
184+
),
185+
'0,-0' => array(
186+
'GPSLatitude' => array('0/0', '0/0', '0/0'),
187+
'GPSLatitudeRef' => 'N',
188+
'GPSLongitude' => array('0/0', '0/0', '0/0'),
189+
'GPSLongitudeRef' => 'W',
190+
),
185191
);
186192

187-
$expected = '40.333452380952,-20.167314814815';
188-
$this->assertEquals($expected, reset($result));
193+
foreach ($expected as $key => $value) {
194+
$result = $this->mapper->mapRawData($value);
195+
$this->assertEquals($key, reset($result));
196+
}
189197
}
190198

191199
public function testMapRawDataCorrectlyFormatsDifferentDateTimeString()

0 commit comments

Comments
 (0)