@@ -15,17 +15,17 @@ class MulticastExecutorTest extends TestCase
15
15
public function setUp ()
16
16
{
17
17
$ this ->nameserver = Factory::DNS ;
18
- $ this ->loop = $ this ->getMock ('React\EventLoop\LoopInterface ' );
19
- $ this ->parser = $ this ->getMock ('React\Dns\Protocol\Parser ' );
20
- $ this ->dumper = $ this ->getMock ('React\Dns\Protocol\BinaryDumper ' );
18
+ $ this ->loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )-> getMock ( );
19
+ $ this ->parser = $ this ->getMockBuilder ('React\Dns\Protocol\Parser ' )-> getMock ( );
20
+ $ this ->dumper = $ this ->getMockBuilder ('React\Dns\Protocol\BinaryDumper ' )-> getMock ( );
21
21
$ this ->sockets = $ this ->getMockBuilder ('Clue\React\Multicast\Factory ' )->disableOriginalConstructor ()->getMock ();
22
22
}
23
23
24
24
public function testQueryWillReturnPromise ()
25
25
{
26
26
$ executor = new MulticastExecutor ($ this ->loop , $ this ->parser , $ this ->dumper , 5 , $ this ->sockets );
27
27
28
- $ socket = $ this ->getMock ('React\Datagram\SocketInterface ' );
28
+ $ socket = $ this ->getMockBuilder ('React\Datagram\SocketInterface ' )-> getMock ( );
29
29
30
30
$ this ->dumper ->expects ($ this ->once ())->method ('toBinary ' )->will ($ this ->returnValue ('message ' ));
31
31
$ this ->sockets ->expects ($ this ->once ())->method ('createSender ' )->will ($ this ->returnValue ($ socket ));
@@ -42,12 +42,12 @@ public function testCancellingPromiseWillCloseSocketAndReject()
42
42
{
43
43
$ executor = new MulticastExecutor ($ this ->loop , $ this ->parser , $ this ->dumper , 5 , $ this ->sockets );
44
44
45
- $ socket = $ this ->getMock ('React\Datagram\SocketInterface ' );
45
+ $ socket = $ this ->getMockBuilder ('React\Datagram\SocketInterface ' )-> getMock ( );
46
46
$ socket ->expects ($ this ->once ())->method ('close ' );
47
47
$ socket ->expects ($ this ->once ())->method ('send ' )->with ($ this ->equalTo ('message ' ), $ this ->equalTo ($ this ->nameserver ));
48
48
$ this ->sockets ->expects ($ this ->once ())->method ('createSender ' )->will ($ this ->returnValue ($ socket ));
49
49
50
- $ timer = $ this ->getMock ('React\EventLoop\Timer\TimerInterface ' );
50
+ $ timer = $ this ->getMockBuilder ('React\EventLoop\Timer\TimerInterface ' )-> getMock ( );
51
51
$ timer ->expects ($ this ->once ())->method ('cancel ' );
52
52
$ this ->loop ->expects ($ this ->once ())->method ('addTimer ' )->willReturn ($ timer );
53
53
@@ -60,6 +60,6 @@ public function testCancellingPromiseWillCloseSocketAndReject()
60
60
61
61
$ ret ->cancel ();
62
62
63
- $ ret ->then ($ this ->expectCallableNever (), $ this ->expectCallableOnceParameter ( 'RuntimeException ' ));
63
+ $ ret ->then ($ this ->expectCallableNever (), $ this ->expectCallableOnceWith ( $ this -> isInstanceOf ( 'RuntimeException ' ) ));
64
64
}
65
65
}
0 commit comments