@@ -16,7 +16,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
16
16
*/
17
17
public function setUp ()
18
18
{
19
- $ adapter = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
19
+ $ adapter = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
20
20
$ this ->reader = new \PHPExif \Reader \Reader ($ adapter );
21
21
}
22
22
@@ -26,7 +26,7 @@ public function setUp()
26
26
*/
27
27
public function testConstructorWithAdapter ()
28
28
{
29
- $ mock = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
29
+ $ mock = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
30
30
$ reflProperty = new \ReflectionProperty ('\PHPExif\Reader\Reader ' , 'adapter ' );
31
31
$ reflProperty ->setAccessible (true );
32
32
@@ -41,7 +41,7 @@ public function testConstructorWithAdapter()
41
41
*/
42
42
public function testGetAdapterFromProperty ()
43
43
{
44
- $ mock = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
44
+ $ mock = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
45
45
46
46
$ reflProperty = new \ReflectionProperty ('\PHPExif\Reader\Reader ' , 'adapter ' );
47
47
$ reflProperty ->setAccessible (true );
@@ -71,7 +71,7 @@ public function testGetAdapterThrowsExceptionWhenNoAdapterIsSet()
71
71
*/
72
72
public function testGetExifPassedToAdapter ()
73
73
{
74
- $ adapter = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
74
+ $ adapter = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
75
75
$ adapter ->expects ($ this ->once ())->method ('getExifFromFile ' );
76
76
77
77
$ reflProperty = new \ReflectionProperty ('\PHPExif\Reader\Reader ' , 'adapter ' );
@@ -138,13 +138,10 @@ public function testFactoryAdapterTypeExiftool()
138
138
*/
139
139
public function testGetExifFromFileCallsReadMethod ()
140
140
{
141
- $ mock = $ this ->getMock (
142
- '\\PHPExif \\Reader \\Reader ' ,
143
- array ('read ' ),
144
- array (),
145
- '' ,
146
- false
147
- );
141
+ $ mock = $ this ->getMockBuilder ('\\PHPExif \\Reader \\Reader ' )
142
+ ->setMethods (array ('read ' ))
143
+ ->disableOriginalConstructor ()
144
+ ->getMock ();
148
145
149
146
$ expected = '/foo/bar/baz ' ;
150
147
$ expectedResult = 'test ' ;
0 commit comments