1010
1111class ConnectionManagerTimeoutTest extends TestCase
1212{
13+ private $ loop ;
14+
1315 public function setUp ()
1416 {
1517 $ this ->loop = React \EventLoop \Factory::create ();
@@ -18,7 +20,7 @@ public function setUp()
1820 public function testTimeoutOkay ()
1921 {
2022 $ will = $ this ->createConnectionManagerMock (true );
21- $ cm = new ConnectionManagerTimeout ($ will , $ this ->loop , 0.1 );
23+ $ cm = new ConnectionManagerTimeout ($ will , 0.1 , $ this ->loop );
2224
2325 $ promise = $ cm ->create ('www.google.com ' , 80 );
2426 $ this ->assertInstanceOf ('React\Promise\PromiseInterface ' , $ promise );
@@ -30,9 +32,9 @@ public function testTimeoutOkay()
3032 public function testTimeoutExpire ()
3133 {
3234 $ will = $ this ->createConnectionManagerMock (new Stream (fopen ('php://temp ' , 'r ' ), $ this ->loop ));
33- $ wont = new ConnectionManagerDelay ($ will , $ this ->loop , 0.2 );
35+ $ wont = new ConnectionManagerDelay ($ will , 0.2 , $ this ->loop );
3436
35- $ cm = new ConnectionManagerTimeout ($ wont , $ this ->loop , 0.1 );
37+ $ cm = new ConnectionManagerTimeout ($ wont , 0.1 , $ this ->loop );
3638
3739 $ promise = $ cm ->create ('www.google.com ' , 80 );
3840 $ this ->assertInstanceOf ('React\Promise\PromiseInterface ' , $ promise );
@@ -45,7 +47,7 @@ public function testTimeoutAbort()
4547 {
4648 $ wont = new ConnectionManagerReject ();
4749
48- $ cm = new ConnectionManagerTimeout ($ wont , $ this ->loop , 0.1 );
50+ $ cm = new ConnectionManagerTimeout ($ wont , 0.1 , $ this ->loop );
4951
5052 $ promise = $ cm ->create ('www.google.com ' , 80 );
5153 $ this ->assertInstanceOf ('React\Promise\PromiseInterface ' , $ promise );
@@ -69,7 +71,7 @@ public function testWillEndConnectionIfConnectionResolvesDespiteTimeout()
6971 $ connector = $ this ->getMock ('React\SocketClient\ConnectorInterface ' );
7072 $ connector ->expects ($ this ->once ())->method ('create ' )->with ('www.google.com ' , 80 )->willReturn ($ promise );
7173
72- $ cm = new ConnectionManagerTimeout ($ connector , $ this ->loop , 0.001 );
74+ $ cm = new ConnectionManagerTimeout ($ connector , 0.001 , $ this ->loop );
7375
7476 $ promise = $ cm ->create ('www.google.com ' , 80 );
7577
@@ -87,7 +89,7 @@ public function testCancellationOfPromiseWillCancelConnectionAttempt()
8789 $ connector = $ this ->getMock ('React\SocketClient\ConnectorInterface ' );
8890 $ connector ->expects ($ this ->once ())->method ('create ' )->with ('www.google.com ' , 80 )->willReturn ($ promise );
8991
90- $ cm = new ConnectionManagerTimeout ($ connector , $ this ->loop , 5.0 );
92+ $ cm = new ConnectionManagerTimeout ($ connector , 5.0 , $ this ->loop );
9193
9294 $ promise = $ cm ->create ('www.google.com ' , 80 );
9395 $ promise ->cancel ();
0 commit comments