Skip to content

Commit ee4d7d2

Browse files
author
Tom Van Herreweghe
committed
Add tests for getData & setData methods
Signed-off-by: Tom Van Herreweghe <tom@king-foo.be>
1 parent b120c2a commit ee4d7d2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/PHPExif/ExifTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,32 @@ public function testSetRawData()
4141
$this->assertEquals($this->exif, $result);
4242
}
4343

44+
/**
45+
* @group exif
46+
*/
47+
public function testGetData()
48+
{
49+
$reflProperty = new \ReflectionProperty('\PHPExif\Exif', 'data');
50+
$reflProperty->setAccessible(true);
51+
52+
$this->assertEquals($reflProperty->getValue($this->exif), $this->exif->getData());
53+
}
54+
55+
/**
56+
* @group exif
57+
*/
58+
public function testSetData()
59+
{
60+
$testData = array('foo', 'bar', 'baz');
61+
$reflProperty = new \ReflectionProperty('\PHPExif\Exif', 'data');
62+
$reflProperty->setAccessible(true);
63+
64+
$result = $this->exif->setData($testData);
65+
66+
$this->assertEquals($testData, $reflProperty->getValue($this->exif));
67+
$this->assertEquals($this->exif, $result);
68+
}
69+
4470
/**
4571
*
4672
* @dataProvider providerUndefinedPropertiesReturnFalse

0 commit comments

Comments
 (0)