File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function testItReturnsTheDecodedMessageToTheHandler()
3232 $ tube = 'foo bar ' ;
3333
3434 $ beanstalkdEnvelope = $ this ->createBeanstalkdEnvelope ();
35- $ connection = $ this ->getMockBuilder (Connection::class)-> disableOriginalConstructor ()-> getMock ( );
35+ $ connection = $ this ->createMock (Connection::class);
3636 $ connection ->expects ($ this ->once ())->method ('get ' )->willReturn ($ beanstalkdEnvelope );
3737 $ connection ->expects ($ this ->once ())->method ('getTube ' )->willReturn ($ tube );
3838
@@ -53,7 +53,7 @@ public function testItReturnsEmptyArrayIfThereAreNoMessages()
5353 {
5454 $ serializer = $ this ->createSerializer ();
5555
56- $ connection = $ this ->getMockBuilder (Connection::class)-> disableOriginalConstructor ()-> getMock ( );
56+ $ connection = $ this ->createMock (Connection::class);
5757 $ connection ->expects ($ this ->once ())->method ('get ' )->willReturn (null );
5858
5959 $ receiver = new BeanstalkdReceiver ($ connection , $ serializer );
@@ -70,7 +70,7 @@ public function testItRejectTheMessageIfThereIsAMessageDecodingFailedException()
7070 $ serializer ->expects ($ this ->once ())->method ('decode ' )->willThrowException (new MessageDecodingFailedException ());
7171
7272 $ beanstalkdEnvelope = $ this ->createBeanstalkdEnvelope ();
73- $ connection = $ this ->getMockBuilder (Connection::class)-> disableOriginalConstructor ()-> getMock ( );
73+ $ connection = $ this ->createMock (Connection::class);
7474 $ connection ->expects ($ this ->once ())->method ('get ' )->willReturn ($ beanstalkdEnvelope );
7575 $ connection ->expects ($ this ->once ())->method ('reject ' );
7676
Original file line number Diff line number Diff line change @@ -26,12 +26,10 @@ public function testSend()
2626 $ envelope = new Envelope (new DummyMessage ('Oy ' ));
2727 $ encoded = ['body ' => '... ' , 'headers ' => ['type ' => DummyMessage::class]];
2828
29- $ connection = $ this ->getMockBuilder (Connection::class)
30- ->disableOriginalConstructor ()
31- ->getMock ();
29+ $ connection = $ this ->createMock (Connection::class);
3230 $ connection ->expects ($ this ->once ())->method ('send ' )->with ($ encoded ['body ' ], $ encoded ['headers ' ], 0 );
3331
34- $ serializer = $ this ->getMockBuilder (SerializerInterface::class)-> getMock ( );
32+ $ serializer = $ this ->createMock (SerializerInterface::class);
3533 $ serializer ->method ('encode ' )->with ($ envelope )->willReturnOnConsecutiveCalls ($ encoded );
3634
3735 $ sender = new BeanstalkdSender ($ connection , $ serializer );
You can’t perform that action at this time.
0 commit comments