File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,31 @@ public function setUp()
1515 $ this ->exif = new \PHPExif \Exif ();
1616 }
1717
18+ /**
19+ * @group exif
20+ */
21+ public function testConstructorCallsSetData ()
22+ {
23+ $ input = array ();
24+
25+ // Get mock, without the constructor being called
26+ $ mock = $ this ->getMockBuilder ('\\PHPExif \\Exif ' )
27+ ->disableOriginalConstructor ()
28+ ->getMock ();
29+
30+ // set expectations for constructor calls
31+ $ mock ->expects ($ this ->once ())
32+ ->method ('setData ' )
33+ ->with (
34+ $ this ->equalTo ($ input )
35+ );
36+
37+ // now call the constructor
38+ $ reflectedClass = new ReflectionClass ('\\PHPExif \\Exif ' );
39+ $ constructor = $ reflectedClass ->getConstructor ();
40+ $ constructor ->invoke ($ mock , $ input );
41+ }
42+
1843 /**
1944 * @group exif
2045 */
You can’t perform that action at this time.
0 commit comments