@@ -55,15 +55,15 @@ public function testCtor(): void
5555 public function testWillConnectWithDefaultPort (): void
5656 {
5757 $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('redis.example.com:6379 ' )->willReturn (reject (new \RuntimeException ()));
58- $ promise = $ this ->factory ->createClient ('redis.example.com ' );
58+ $ promise = $ this ->factory ->createClient ('redis://redis .example.com ' );
5959
6060 $ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
6161 }
6262
6363 public function testWillConnectToLocalhost (): void
6464 {
6565 $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('localhost:1337 ' )->willReturn (reject (new \RuntimeException ()));
66- $ promise = $ this ->factory ->createClient ('localhost:1337 ' );
66+ $ promise = $ this ->factory ->createClient ('redis:// localhost:1337 ' );
6767
6868 $ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
6969 }
@@ -74,7 +74,7 @@ public function testWillResolveIfConnectorResolves(): void
7474 $ stream ->expects ($ this ->never ())->method ('write ' );
7575
7676 $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->willReturn (resolve ($ stream ));
77- $ promise = $ this ->factory ->createClient ('localhost ' );
77+ $ promise = $ this ->factory ->createClient ('redis:// localhost ' );
7878
7979 $ this ->expectPromiseResolve ($ promise );
8080 }
@@ -483,23 +483,6 @@ public function testWillRejectIfConnectorRejects(): void
483483 ));
484484 }
485485
486- public function testWillRejectIfTargetIsInvalid (): void
487- {
488- $ promise = $ this ->factory ->createClient ('http://invalid target ' );
489-
490- $ promise ->then (null , $ this ->expectCallableOnceWith (
491- $ this ->logicalAnd (
492- $ this ->isInstanceOf (\InvalidArgumentException::class),
493- $ this ->callback (function (\InvalidArgumentException $ e ) {
494- return $ e ->getMessage () === 'Invalid Redis URI given (EINVAL) ' ;
495- }),
496- $ this ->callback (function (\InvalidArgumentException $ e ) {
497- return $ e ->getCode () === (defined ('SOCKET_EINVAL ' ) ? SOCKET_EINVAL : 22 );
498- })
499- )
500- ));
501- }
502-
503486 public function testCancelWillRejectPromise (): void
504487 {
505488 $ promise = new \React \Promise \Promise (function () { });
@@ -516,10 +499,6 @@ public function testCancelWillRejectPromise(): void
516499 public function provideUris (): array
517500 {
518501 return [
519- [
520- 'localhost ' ,
521- 'redis://localhost '
522- ],
523502 [
524503 'redis://localhost ' ,
525504 'redis://localhost '
@@ -705,7 +684,7 @@ public function testCreateClientWillCancelTimerWhenConnectionResolves(): void
705684 $ deferred = new Deferred ();
706685 $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('127.0.0.1:6379 ' )->willReturn ($ deferred ->promise ());
707686
708- $ promise = $ this ->factory ->createClient ('127.0.0.1 ' );
687+ $ promise = $ this ->factory ->createClient ('redis:// 127.0.0.1 ' );
709688 $ promise ->then ($ this ->expectCallableOnce ());
710689
711690 $ deferred ->resolve ($ this ->createMock (ConnectionInterface::class));
@@ -723,7 +702,7 @@ public function testCreateClientWillCancelTimerWhenConnectionRejects(): void
723702 $ deferred = new Deferred ();
724703 $ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('127.0.0.1:6379 ' )->willReturn ($ deferred ->promise ());
725704
726- $ promise = $ this ->factory ->createClient ('127.0.0.1 ' );
705+ $ promise = $ this ->factory ->createClient ('redis:// 127.0.0.1 ' );
727706
728707 $ promise ->then (null , $ this ->expectCallableOnceWith ($ this ->isInstanceOf ('RuntimeException ' )));
729708
0 commit comments