@@ -16,7 +16,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
1616 */
1717 public function setUp ()
1818 {
19- $ adapter = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
19+ $ adapter = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
2020 $ this ->reader = new \PHPExif \Reader \Reader ($ adapter );
2121 }
2222
@@ -26,7 +26,7 @@ public function setUp()
2626 */
2727 public function testConstructorWithAdapter ()
2828 {
29- $ mock = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
29+ $ mock = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
3030 $ reflProperty = new \ReflectionProperty ('\PHPExif\Reader\Reader ' , 'adapter ' );
3131 $ reflProperty ->setAccessible (true );
3232
@@ -41,7 +41,7 @@ public function testConstructorWithAdapter()
4141 */
4242 public function testGetAdapterFromProperty ()
4343 {
44- $ mock = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
44+ $ mock = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
4545
4646 $ reflProperty = new \ReflectionProperty ('\PHPExif\Reader\Reader ' , 'adapter ' );
4747 $ reflProperty ->setAccessible (true );
@@ -71,7 +71,7 @@ public function testGetAdapterThrowsExceptionWhenNoAdapterIsSet()
7171 */
7272 public function testGetExifPassedToAdapter ()
7373 {
74- $ adapter = $ this ->getMock ('\PHPExif\Adapter\AdapterInterface ' );
74+ $ adapter = $ this ->getMockBuilder ('\PHPExif\Adapter\AdapterInterface ' )-> getMockForAbstractClass ( );
7575 $ adapter ->expects ($ this ->once ())->method ('getExifFromFile ' );
7676
7777 $ reflProperty = new \ReflectionProperty ('\PHPExif\Reader\Reader ' , 'adapter ' );
@@ -138,13 +138,10 @@ public function testFactoryAdapterTypeExiftool()
138138 */
139139 public function testGetExifFromFileCallsReadMethod ()
140140 {
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 ();
148145
149146 $ expected = '/foo/bar/baz ' ;
150147 $ expectedResult = 'test ' ;
0 commit comments