@@ -31,7 +31,7 @@ public function testPingWillNotCloseConnectionWhenPendingConnectionFails()
31
31
public function testPingWillNotCloseConnectionWhenUnderlyingConnectionCloses ()
32
32
{
33
33
$ base = $ this ->getMockBuilder ('React\MySQL\Io\LazyConnection ' )->setMethods (['ping ' ])->disableOriginalConstructor ()->getMock ();
34
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
34
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
35
35
36
36
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
37
37
$ factory ->expects ($ this ->once ())->method ('createConnection ' )->willReturn (\React \Promise \resolve ($ base ));
@@ -48,7 +48,7 @@ public function testPingWillNotCloseConnectionWhenUnderlyingConnectionCloses()
48
48
public function testPingWillCancelTimerWithoutClosingConnectionWhenUnderlyingConnectionCloses ()
49
49
{
50
50
$ base = $ this ->getMockBuilder ('React\MySQL\Io\LazyConnection ' )->setMethods (['ping ' ])->disableOriginalConstructor ()->getMock ();
51
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
51
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
52
52
53
53
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
54
54
$ factory ->expects ($ this ->once ())->method ('createConnection ' )->willReturn (\React \Promise \resolve ($ base ));
@@ -69,7 +69,7 @@ public function testPingWillCancelTimerWithoutClosingConnectionWhenUnderlyingCon
69
69
public function testPingWillNotForwardErrorFromUnderlyingConnection ()
70
70
{
71
71
$ base = $ this ->getMockBuilder ('React\MySQL\Io\LazyConnection ' )->setMethods (['ping ' ])->disableOriginalConstructor ()->getMock ();
72
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
72
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
73
73
74
74
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
75
75
$ factory ->expects ($ this ->once ())->method ('createConnection ' )->willReturn (\React \Promise \resolve ($ base ));
@@ -87,8 +87,8 @@ public function testPingWillNotForwardErrorFromUnderlyingConnection()
87
87
public function testPingFollowedByIdleTimerWillQuitUnderlyingConnection ()
88
88
{
89
89
$ base = $ this ->getMockBuilder ('React\MySQL\Io\LazyConnection ' )->setMethods (['ping ' , 'quit ' , 'close ' ])->disableOriginalConstructor ()->getMock ();
90
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
91
- $ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (\React \Promise \resolve ());
90
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
91
+ $ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (\React \Promise \resolve (null ));
92
92
$ base ->expects ($ this ->never ())->method ('close ' );
93
93
94
94
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
@@ -115,8 +115,8 @@ public function testPingFollowedByIdleTimerWillQuitUnderlyingConnection()
115
115
public function testPingFollowedByIdleTimerWillCloseUnderlyingConnectionWhenQuitFails ()
116
116
{
117
117
$ base = $ this ->getMockBuilder ('React\MySQL\Io\LazyConnection ' )->setMethods (['ping ' , 'quit ' , 'close ' ])->disableOriginalConstructor ()->getMock ();
118
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
119
- $ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (\React \Promise \reject ());
118
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
119
+ $ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (\React \Promise \reject (new \ RuntimeException () ));
120
120
$ base ->expects ($ this ->once ())->method ('close ' );
121
121
122
122
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
@@ -143,7 +143,7 @@ public function testPingFollowedByIdleTimerWillCloseUnderlyingConnectionWhenQuit
143
143
public function testPingAfterIdleTimerWillCloseUnderlyingConnectionBeforeCreatingSecondConnection ()
144
144
{
145
145
$ base = $ this ->getMockBuilder ('React\MySQL\Io\LazyConnection ' )->setMethods (['ping ' , 'quit ' , 'close ' ])->disableOriginalConstructor ()->getMock ();
146
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
146
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
147
147
$ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (new Promise (function () { }));
148
148
$ base ->expects ($ this ->once ())->method ('close ' );
149
149
@@ -289,7 +289,7 @@ public function testQueryBeforePingWillResolveWithoutStartingTimerWhenQueryFromU
289
289
public function testQueryAfterPingWillCancelTimerAgainWhenPingFromUnderlyingConnectionResolved ()
290
290
{
291
291
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
292
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
292
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
293
293
$ base ->expects ($ this ->once ())->method ('query ' )->with ('SELECT 1 ' )->willReturn (new Promise (function () { }));
294
294
295
295
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
@@ -480,7 +480,7 @@ public function testPingWillTryToCreateNewUnderlyingConnectionAfterPreviousPingF
480
480
public function testPingWillResolveAndStartTimerWhenPingFromUnderlyingConnectionResolves ()
481
481
{
482
482
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
483
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
483
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
484
484
485
485
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
486
486
$ factory ->expects ($ this ->once ())->method ('createConnection ' )->willReturn (\React \Promise \resolve ($ base ));
@@ -570,7 +570,7 @@ public function testQuitAfterPingReturnsPendingPromiseWhenConnectionIsPending()
570
570
public function testQuitAfterPingWillQuitUnderlyingConnectionWhenResolved ()
571
571
{
572
572
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
573
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
573
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
574
574
$ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (new Promise (function () { }));
575
575
576
576
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
@@ -585,8 +585,8 @@ public function testQuitAfterPingWillQuitUnderlyingConnectionWhenResolved()
585
585
public function testQuitAfterPingResolvesAndEmitsCloseWhenUnderlyingConnectionQuits ()
586
586
{
587
587
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
588
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
589
- $ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (\React \Promise \resolve ());
588
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
589
+ $ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (\React \Promise \resolve (null ));
590
590
591
591
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
592
592
$ factory ->expects ($ this ->once ())->method ('createConnection ' )->willReturn (\React \Promise \resolve ($ base ));
@@ -606,7 +606,7 @@ public function testQuitAfterPingRejectsAndEmitsCloseWhenUnderlyingConnectionFai
606
606
{
607
607
$ error = new \RuntimeException ();
608
608
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
609
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
609
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
610
610
$ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (\React \Promise \reject ($ error ));
611
611
612
612
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
@@ -651,7 +651,7 @@ public function testCloseAfterPingCancelsPendingConnection()
651
651
public function testCloseTwiceAfterPingWillCloseUnderlyingConnectionWhenResolved ()
652
652
{
653
653
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
654
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
654
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
655
655
$ base ->expects ($ this ->once ())->method ('close ' );
656
656
657
657
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
@@ -685,7 +685,7 @@ public function testCloseAfterPingDoesNotEmitConnectionErrorFromAbortedConnectio
685
685
public function testCloseAfterPingWillCancelTimerWhenPingFromUnderlyingConnectionResolves ()
686
686
{
687
687
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
688
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
688
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
689
689
690
690
$ factory = $ this ->getMockBuilder ('React\MySQL\Factory ' )->disableOriginalConstructor ()->getMock ();
691
691
$ factory ->expects ($ this ->once ())->method ('createConnection ' )->willReturn (\React \Promise \resolve ($ base ));
@@ -704,7 +704,7 @@ public function testCloseAfterPingWillCancelTimerWhenPingFromUnderlyingConnectio
704
704
public function testCloseAfterPingHasResolvedWillCloseUnderlyingConnectionWithoutTryingToCancelConnection ()
705
705
{
706
706
$ base = $ this ->getMockBuilder ('React\MySQL\Io\LazyConnection ' )->setMethods (['ping ' , 'close ' ])->disableOriginalConstructor ()->getMock ();
707
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
707
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
708
708
$ base ->expects ($ this ->once ())->method ('close ' )->willReturnCallback (function () use ($ base ) {
709
709
$ base ->emit ('close ' );
710
710
});
@@ -723,7 +723,7 @@ public function testCloseAfterPingHasResolvedWillCloseUnderlyingConnectionWithou
723
723
public function testCloseAfterQuitAfterPingWillCloseUnderlyingConnectionWhenQuitIsStillPending ()
724
724
{
725
725
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
726
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
726
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
727
727
$ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (new Promise (function () { }));
728
728
$ base ->expects ($ this ->once ())->method ('close ' );
729
729
@@ -740,7 +740,7 @@ public function testCloseAfterQuitAfterPingWillCloseUnderlyingConnectionWhenQuit
740
740
public function testCloseAfterPingAfterIdleTimeoutWillCloseUnderlyingConnectionWhenQuitIsStillPending ()
741
741
{
742
742
$ base = $ this ->getMockBuilder ('React\MySQL\ConnectionInterface ' )->getMock ();
743
- $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve ());
743
+ $ base ->expects ($ this ->once ())->method ('ping ' )->willReturn (\React \Promise \resolve (null ));
744
744
$ base ->expects ($ this ->once ())->method ('quit ' )->willReturn (new Promise (function () { }));
745
745
$ base ->expects ($ this ->once ())->method ('close ' );
746
746
0 commit comments