@@ -23,19 +23,19 @@ public function testCtor()
2323
2424 public function testWillConnectToLocalIpWithDefaultPortIfTargetIsNotGiven ()
2525 {
26- $ this ->connector ->expects ($ this ->once ())->method ('create ' )->with ('127.0.0.1 ' , 6379 )->willReturn (Promise \reject (new \RuntimeException ()));
26+ $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('127.0.0.1: 6379 ' )->willReturn (Promise \reject (new \RuntimeException ()));
2727 $ this ->factory ->createClient ();
2828 }
2929
3030 public function testWillConnectWithDefaultPort ()
3131 {
32- $ this ->connector ->expects ($ this ->once ())->method ('create ' )->with ('redis.example.com ' , 6379 )->willReturn (Promise \reject (new \RuntimeException ()));
32+ $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('redis.example.com: 6379 ' )->willReturn (Promise \reject (new \RuntimeException ()));
3333 $ this ->factory ->createClient ('redis.example.com ' );
3434 }
3535
3636 public function testWillConnectToLocalIpWhenTargetIsLocalhost ()
3737 {
38- $ this ->connector ->expects ($ this ->once ())->method ('create ' )->with ('127.0.0.1 ' , 1337 )->willReturn (Promise \reject (new \RuntimeException ()));
38+ $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('127.0.0.1: 1337 ' )->willReturn (Promise \reject (new \RuntimeException ()));
3939 $ this ->factory ->createClient ('tcp://localhost:1337 ' );
4040 }
4141
@@ -44,7 +44,7 @@ public function testWillResolveIfConnectorResolves()
4444 $ stream = $ this ->getMockBuilder ('React\Stream\Stream ' )->disableOriginalConstructor ()->getMock ();
4545 $ stream ->expects ($ this ->never ())->method ('write ' );
4646
47- $ this ->connector ->expects ($ this ->once ())->method ('create ' )->willReturn (Promise \resolve ($ stream ));
47+ $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->willReturn (Promise \resolve ($ stream ));
4848 $ promise = $ this ->factory ->createClient ();
4949
5050 $ this ->expectPromiseResolve ($ promise );
@@ -55,7 +55,7 @@ public function testWillWriteSelectCommandIfTargetContainsPath()
5555 $ stream = $ this ->getMockBuilder ('React\Stream\Stream ' )->disableOriginalConstructor ()->getMock ();
5656 $ stream ->expects ($ this ->once ())->method ('write ' )->with ("*2 \r\n$6 \r\nselect \r\n$4 \r\ndemo \r\n" );
5757
58- $ this ->connector ->expects ($ this ->once ())->method ('create ' )->willReturn (Promise \resolve ($ stream ));
58+ $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->willReturn (Promise \resolve ($ stream ));
5959 $ this ->factory ->createClient ('tcp://127.0.0.1/demo ' );
6060 }
6161
@@ -64,13 +64,13 @@ public function testWillWriteAuthCommandIfTargetContainsUserInfo()
6464 $ stream = $ this ->getMockBuilder ('React\Stream\Stream ' )->disableOriginalConstructor ()->getMock ();
6565 $ stream ->expects ($ this ->once ())->method ('write ' )->with ("*2 \r\n$4 \r\nauth \r\n$11 \r\nhello:world \r\n" );
6666
67- $ this ->connector ->expects ($ this ->once ())->method ('create ' )->willReturn (Promise \resolve ($ stream ));
67+ $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->willReturn (Promise \resolve ($ stream ));
6868 $ this ->
factory ->
createClient (
'tcp://hello:[email protected] ' );
6969 }
7070
7171 public function testWillRejectIfConnectorRejects ()
7272 {
73- $ this ->connector ->expects ($ this ->once ())->method ('create ' )->with ('127.0.0.1 ' , 2 )->willReturn (Promise \reject (new \RuntimeException ()));
73+ $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('127.0.0.1:2 ' )->willReturn (Promise \reject (new \RuntimeException ()));
7474 $ promise = $ this ->factory ->createClient ('tcp://127.0.0.1:2 ' );
7575
7676 $ this ->expectPromiseReject ($ promise );
0 commit comments