22
33namespace Illuminate \Tests \Redis ;
44
5+ use Illuminate \Foundation \Application ;
56use Illuminate \Foundation \Testing \Concerns \InteractsWithRedis ;
7+ use Illuminate \Redis \RedisManager ;
68use PHPUnit \Framework \TestCase ;
79use Redis ;
810
@@ -39,7 +41,7 @@ public function testUrl()
3941 $ host = env ('REDIS_HOST ' , '127.0.0.1 ' );
4042 $ port = env ('REDIS_PORT ' , 6379 );
4143
42- $ predis = $ this -> getRedisManager ( ' predis ' , 'predis ' , [
44+ $ predis = new RedisManager ( new Application , 'predis ' , [
4345 'cluster ' => false ,
4446 'options ' => [
4547 'prefix ' => 'test_ ' ,
@@ -77,21 +79,20 @@ public function testUrlWithScheme()
7779 $ host = env ('REDIS_HOST ' , '127.0.0.1 ' );
7880 $ port = env ('REDIS_PORT ' , 6379 );
7981
80- $ predis = $ this -> getRedisManager ( ' predis ' , 'predis ' , [
82+ $ predis = new RedisManager ( new Application , 'predis ' , [
8183 'cluster ' => false ,
8284 'options ' => [
8385 'prefix ' => 'test_ ' ,
8486 ],
8587 'default ' => [
86- 'url ' => "tls1.2 :// {$ host }: {$ port }" ,
88+ 'url ' => "tls :// {$ host }: {$ port }" ,
8789 'database ' => 5 ,
8890 'timeout ' => 0.5 ,
8991 ],
9092 ]);
9193 $ predisClient = $ predis ->connection ()->client ();
9294 $ parameters = $ predisClient ->getConnection ()->getParameters ();
93- // Predis can not recognize properly different tls versions and reports tcp in that case.
94- $ this ->assertSame ('tcp ' , $ parameters ->scheme );
95+ $ this ->assertSame ('tls ' , $ parameters ->scheme );
9596 $ this ->assertEquals ($ host , $ parameters ->host );
9697 $ this ->assertEquals ($ port , $ parameters ->port );
9798
@@ -116,7 +117,7 @@ public function testScheme()
116117 $ host = env ('REDIS_HOST ' , '127.0.0.1 ' );
117118 $ port = env ('REDIS_PORT ' , 6379 );
118119
119- $ predis = $ this -> getRedisManager ( ' predis ' , 'predis ' , [
120+ $ predis = new RedisManager ( new Application , 'predis ' , [
120121 'cluster ' => false ,
121122 'options ' => [
122123 'prefix ' => 'test_ ' ,
@@ -160,7 +161,7 @@ public function testPredisConfigurationWithUsername()
160161 $ username = 'testuser ' ;
161162 $ password = 'testpw ' ;
162163
163- $ predis = $ this -> getRedisManager ( ' predis ' , 'predis ' , [
164+ $ predis = new RedisManager ( new Application , 'predis ' , [
164165 'default ' => [
165166 'host ' => $ host ,
166167 'port ' => $ port ,
@@ -181,7 +182,7 @@ public function testPredisConfigurationWithSentinel()
181182 $ host = env ('REDIS_HOST ' , '127.0.0.1 ' );
182183 $ port = env ('REDIS_PORT ' , 6379 );
183184
184- $ predis = $ this -> getRedisManager ( ' predis ' , 'predis ' , [
185+ $ predis = new RedisManager ( new Application , 'predis ' , [
185186 'cluster ' => false ,
186187 'options ' => [
187188 'replication ' => 'sentinel ' ,
@@ -246,7 +247,7 @@ public function testPrefixOverrideBehaviour()
246247 $ predisClient2 = $ predis2 ->client ();
247248 $ this ->assertEquals ('test_default_config_ ' , $ predisClient2 ->getOptions ()->prefix ->getPrefix ());
248249
249- $ phpRedis1 = new RedisManager ( new Application , 'phpredis ' , [
250+ $ phpRedis1 = $ this -> getRedisManager ( ' phpredis ' , 'phpredis ' , [
250251 'cluster ' => false ,
251252 'options ' => [
252253 'prefix ' => 'test_ ' ,
@@ -265,7 +266,7 @@ public function testPrefixOverrideBehaviour()
265266 $ phpRedisClient1 = $ phpRedis1 ->connection ()->client ();
266267 $ this ->assertEquals ('test_default_options_ ' , $ phpRedisClient1 ->getOption (Redis::OPT_PREFIX ));
267268
268- $ phpRedis2 = new RedisManager ( new Application , 'phpredis ' , [
269+ $ phpRedis2 = $ this -> getRedisManager ( ' phpredis ' , 'phpredis ' , [
269270 'cluster ' => false ,
270271 'options ' => [
271272 'prefix ' => 'test_ ' ,
0 commit comments