@@ -16,7 +16,7 @@ class CheckRepositoryTest extends PHPUnit_Framework_TestCase
1616{
1717 public function testRegisterViaConstructor ()
1818 {
19- $ check = $ this ->getMock (CheckInterface::class);
19+ $ check = $ this ->createMock (CheckInterface::class);
2020 $ repository = new CheckRepository ([$ check ]);
2121 $ this ->assertEquals ([$ check ], $ repository ->getAll ());
2222 }
@@ -26,17 +26,17 @@ public function testRegisterCheck()
2626 $ repository = new CheckRepository ;
2727 $ this ->assertEquals ([], $ repository ->getAll ());
2828
29- $ check = $ this ->getMock (CheckInterface::class);
29+ $ check = $ this ->createMock (CheckInterface::class);
3030 $ repository ->registerCheck ($ check );
3131 $ this ->assertEquals ([$ check ], $ repository ->getAll ());
3232 }
3333
3434 public function testHas ()
3535 {
3636 $ repository = new CheckRepository ;
37- $ repository ->registerCheck ($ this ->getMock (CheckInterface::class));
37+ $ repository ->registerCheck ($ this ->createMock (CheckInterface::class));
3838
39- $ check = $ this ->getMock (CheckInterface::class);
39+ $ check = $ this ->createMock (CheckInterface::class);
4040 $ repository ->registerCheck ($ check );
4141
4242 $ this ->assertTrue ($ repository ->has (get_class ($ check )));
@@ -46,22 +46,20 @@ public function testHas()
4646 public function testGetByClassThrowsExceptionIfNotExist ()
4747 {
4848 $ repository = new CheckRepository ;
49- $ repository ->registerCheck ($ this ->getMock (CheckInterface::class));
49+ $ repository ->registerCheck ($ this ->createMock (CheckInterface::class));
5050
51- $ this ->setExpectedException (
52- InvalidArgumentException::class,
53- 'Check: "SomeClassWhichDoesNotExist" does not exist '
54- );
51+ $ this ->expectException (InvalidArgumentException::class);
52+ $ this ->expectExceptionMessage ('Check: "SomeClassWhichDoesNotExist" does not exist ' );
5553
5654 $ repository ->getByClass ('SomeClassWhichDoesNotExist ' );
5755 }
5856
5957 public function testGetByClass ()
6058 {
6159 $ repository = new CheckRepository ;
62- $ repository ->registerCheck ($ this ->getMock (CheckInterface::class));
60+ $ repository ->registerCheck ($ this ->createMock (CheckInterface::class));
6361
64- $ check = $ this ->getMock (CheckInterface::class);
62+ $ check = $ this ->createMock (CheckInterface::class);
6563 $ repository ->registerCheck ($ check );
6664
6765 $ this ->assertSame ($ check , $ repository ->getByClass (get_class ($ check )));
0 commit comments