@@ -186,5 +186,54 @@ public function testMapRawDataCorrectlyFormatsNumericGPSData()
186186 $ this ->assertCount (1 , $ result );
187187 $ this ->assertEquals ($ expected , reset ($ result ));
188188 }
189-
189+
190+ /**
191+ * @group mapper
192+ * @covers \PHPExif\Mapper\Exiftool::mapRawData
193+ */
194+ public function testMapRawDataCorrectlyIgnoresIncorrectGPSData ()
195+ {
196+ $ this ->mapper ->setNumeric (false );
197+ $ result = $ this ->mapper ->mapRawData (
198+ array (
199+ 'GPSLatitude ' => '40.333452381 ' ,
200+ 'GPSLatitudeRef ' => 'North ' ,
201+ 'GPSLongitude ' => '20.167314814 ' ,
202+ 'GPSLongitudeRef ' => 'West ' ,
203+ )
204+ );
205+
206+ $ this ->assertCount (0 , $ result );
207+ }
208+
209+ /**
210+ * @group mapper
211+ * @covers \PHPExif\Mapper\Exiftool::mapRawData
212+ */
213+ public function testMapRawDataCorrectlyIgnoresIncompleteGPSData ()
214+ {
215+ $ result = $ this ->mapper ->mapRawData (
216+ array (
217+ 'GPSLatitude ' => '40.333452381 ' ,
218+ 'GPSLatitudeRef ' => 'North ' ,
219+ )
220+ );
221+
222+ $ this ->assertCount (0 , $ result );
223+ }
224+
225+ /**
226+ * @group mapper
227+ * @covers \PHPExif\Mapper\Exiftool::setNumeric
228+ */
229+ public function testSetNumericInProperty ()
230+ {
231+ $ reflProperty = new \ReflectionProperty (get_class ($ this ->mapper ), 'numeric ' );
232+ $ reflProperty ->setAccessible (true );
233+
234+ $ expected = true ;
235+ $ this ->mapper ->setNumeric ($ expected );
236+
237+ $ this ->assertEquals ($ expected , $ reflProperty ->getValue ($ this ->mapper ));
238+ }
190239}
0 commit comments