@@ -55,15 +55,15 @@ public function testCtor(): void
55
55
public function testWillConnectWithDefaultPort (): void
56
56
{
57
57
$ 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 ' );
59
59
60
60
$ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
61
61
}
62
62
63
63
public function testWillConnectToLocalhost (): void
64
64
{
65
65
$ 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 ' );
67
67
68
68
$ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
69
69
}
@@ -74,7 +74,7 @@ public function testWillResolveIfConnectorResolves(): void
74
74
$ stream ->expects ($ this ->never ())->method ('write ' );
75
75
76
76
$ this ->connector ->expects ($ this ->once ())->method ('connect ' )->willReturn (resolve ($ stream ));
77
- $ promise = $ this ->factory ->createClient ('localhost ' );
77
+ $ promise = $ this ->factory ->createClient ('redis:// localhost ' );
78
78
79
79
$ this ->expectPromiseResolve ($ promise );
80
80
}
@@ -483,23 +483,6 @@ public function testWillRejectIfConnectorRejects(): void
483
483
));
484
484
}
485
485
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
-
503
486
public function testCancelWillRejectPromise (): void
504
487
{
505
488
$ promise = new \React \Promise \Promise (function () { });
@@ -516,10 +499,6 @@ public function testCancelWillRejectPromise(): void
516
499
public function provideUris (): array
517
500
{
518
501
return [
519
- [
520
- 'localhost ' ,
521
- 'redis://localhost '
522
- ],
523
502
[
524
503
'redis://localhost ' ,
525
504
'redis://localhost '
@@ -705,7 +684,7 @@ public function testCreateClientWillCancelTimerWhenConnectionResolves(): void
705
684
$ deferred = new Deferred ();
706
685
$ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('127.0.0.1:6379 ' )->willReturn ($ deferred ->promise ());
707
686
708
- $ promise = $ this ->factory ->createClient ('127.0.0.1 ' );
687
+ $ promise = $ this ->factory ->createClient ('redis:// 127.0.0.1 ' );
709
688
$ promise ->then ($ this ->expectCallableOnce ());
710
689
711
690
$ deferred ->resolve ($ this ->createMock (ConnectionInterface::class));
@@ -723,7 +702,7 @@ public function testCreateClientWillCancelTimerWhenConnectionRejects(): void
723
702
$ deferred = new Deferred ();
724
703
$ this ->connector ->expects ($ this ->once ())->method ('connect ' )->with ('127.0.0.1:6379 ' )->willReturn ($ deferred ->promise ());
725
704
726
- $ promise = $ this ->factory ->createClient ('127.0.0.1 ' );
705
+ $ promise = $ this ->factory ->createClient ('redis:// 127.0.0.1 ' );
727
706
728
707
$ promise ->then (null , $ this ->expectCallableOnceWith ($ this ->isInstanceOf ('RuntimeException ' )));
729
708
0 commit comments