Skip to content

Commit 1e2e623

Browse files
author
Tom Van Herreweghe
committed
More unit tests for Exif (GPS added)
Signed-off-by: Tom Van Herreweghe <[email protected]>
1 parent 476367b commit 1e2e623

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: tests/PHPExif/ExifTest.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public function testSetData()
128128
* @covers \PHPExif\Exif::getHeadline
129129
* @covers \PHPExif\Exif::getColorSpace
130130
* @covers \PHPExif\Exif::getOrientation
131+
* @covers \PHPExif\Exif::getGPS
131132
* @param string $accessor
132133
*/
133134
public function testUndefinedPropertiesReturnFalse($accessor)
@@ -171,6 +172,7 @@ public function providerUndefinedPropertiesReturnFalse()
171172
array('getHeadline'),
172173
array('getColorSpace'),
173174
array('getOrientation'),
175+
array('getGPS'),
174176
);
175177
}
176178

@@ -527,6 +529,7 @@ public function testGetGPS()
527529
* @covers \PHPExif\Exif::setHeadline
528530
* @covers \PHPExif\Exif::setColorSpace
529531
* @covers \PHPExif\Exif::setOrientation
532+
* @covers \PHPExif\Exif::setGPS
530533
*/
531534
public function testMutatorMethodsSetInProperty()
532535
{
@@ -547,10 +550,14 @@ public function testMutatorMethodsSetInProperty()
547550
$propertyValue = $reflProp->getValue($this->exif);
548551
$this->assertSame($now, $propertyValue[$value]);
549552
break;
550-
case 'focalDistance':
551-
$setter = 'setFocusDistance';
552553
case 'gps':
554+
$coords = '40.333452380556,-20.167314813889';
555+
$this->exif->$setter($coords);
556+
$propertyValue = $reflProp->getValue($this->exif);
557+
$this->assertEquals($expected, $propertyValue[$value]);
553558
break;
559+
case 'focalDistance':
560+
$setter = 'setFocusDistance';
554561
default:
555562
$this->exif->$setter($expected);
556563
$propertyValue = $reflProp->getValue($this->exif);

0 commit comments

Comments
 (0)