88use Illuminate \Redis \Connections \PhpRedisClusterConnection ;
99use Illuminate \Redis \Connections \PredisClusterConnection ;
1010use Illuminate \Support \Facades \Cache ;
11- use Illuminate \Support \Facades \Redis ;
1211use Illuminate \Support \Sleep ;
1312use Mockery as m ;
1413use Orchestra \Testbench \TestCase ;
@@ -23,12 +22,6 @@ protected function setUp(): void
2322 {
2423 $ this ->afterApplicationCreated (function () {
2524 $ this ->setUpRedis ();
26-
27- $ connection = $ this ->app ['redis ' ]->connection ();
28- $ this ->markTestSkippedWhen (
29- $ connection instanceof PhpRedisClusterConnection || $ connection instanceof PredisClusterConnection,
30- 'RedisStore currently does not support tags, many and some other on Redis Cluster cluster connections ' ,
31- );
3225 });
3326
3427 $ this ->beforeApplicationDestroyed (function () {
@@ -103,6 +96,8 @@ public function testItCanExpireWithZeroTTL()
10396
10497 public function testTagsCanBeAccessed ()
10598 {
99+ $ this ->markTestSkippedWithPredisClusterConnection ();
100+
106101 Cache::store ('redis ' )->clear ();
107102
108103 Cache::store ('redis ' )->tags (['people ' , 'author ' ])->put ('name ' , 'Sally ' , 5 );
@@ -119,6 +114,8 @@ public function testTagsCanBeAccessed()
119114
120115 public function testTagEntriesCanBeStoredForever ()
121116 {
117+ $ this ->markTestSkippedWithPredisClusterConnection ();
118+
122119 Cache::store ('redis ' )->clear ();
123120
124121 Cache::store ('redis ' )->tags (['people ' , 'author ' ])->forever ('name ' , 'Sally ' );
@@ -151,6 +148,8 @@ public function testTagEntriesCanBeIncremented()
151148
152149 public function testIncrementedTagEntriesProperlyTurnStale ()
153150 {
151+ $ this ->markTestSkippedWithPredisClusterConnection ();
152+
154153 Cache::store ('redis ' )->clear ();
155154
156155 Cache::store ('redis ' )->tags (['votes ' ])->add ('person-1 ' , 0 , $ seconds = 1 );
@@ -167,6 +166,8 @@ public function testIncrementedTagEntriesProperlyTurnStale()
167166
168167 public function testPastTtlTagEntriesAreNotAdded ()
169168 {
169+ $ this ->markTestSkippedWithPredisClusterConnection ();
170+
170171 Cache::store ('redis ' )->clear ();
171172
172173 Cache::store ('redis ' )->tags (['votes ' ])->add ('person-1 ' , 0 , new DateTime ('yesterday ' ));
@@ -180,6 +181,8 @@ public function testPastTtlTagEntriesAreNotAdded()
180181
181182 public function testPutPastTtlTagEntriesProperlyTurnStale ()
182183 {
184+ $ this ->markTestSkippedWithPredisClusterConnection ();
185+
183186 Cache::store ('redis ' )->clear ();
184187
185188 Cache::store ('redis ' )->tags (['votes ' ])->put ('person-1 ' , 0 , new DateTime ('yesterday ' ));
@@ -191,6 +194,8 @@ public function testPutPastTtlTagEntriesProperlyTurnStale()
191194
192195 public function testTagsCanBeFlushedBySingleKey ()
193196 {
197+ $ this ->markTestSkippedWithPredisClusterConnection ();
198+
194199 Cache::store ('redis ' )->clear ();
195200
196201 Cache::store ('redis ' )->tags (['people ' , 'author ' ])->put ('person-1 ' , 'Sally ' , 5 );
@@ -207,6 +212,8 @@ public function testTagsCanBeFlushedBySingleKey()
207212
208213 public function testStaleEntriesCanBeFlushed ()
209214 {
215+ $ this ->markTestSkippedWithPredisClusterConnection ();
216+
210217 Cache::store ('redis ' )->clear ();
211218
212219 Cache::store ('redis ' )->tags (['people ' , 'author ' ])->put ('person-1 ' , 'Sally ' , 1 );
@@ -277,6 +284,8 @@ public function testIncrementWithSerializationEnabled()
277284
278285 public function testTagsCanBeFlushedWithLargeNumberOfKeys ()
279286 {
287+ $ this ->markTestSkippedWithPredisClusterConnection ();
288+
280289 Cache::store ('redis ' )->clear ();
281290
282291 $ tags = ['large-test- ' .time ()];
@@ -298,4 +307,12 @@ public function testTagsCanBeFlushedWithLargeNumberOfKeys()
298307 $ keyCount = Cache::store ('redis ' )->connection ()->keys ('* ' );
299308 $ this ->assertCount (0 , $ keyCount );
300309 }
310+
311+ protected function markTestSkippedWithPredisClusterConnection ()
312+ {
313+ $ this ->markTestSkippedWhen (
314+ $ this ->app ['redis ' ]->connection () instanceof PredisClusterConnection,
315+ 'This test currently fails on Predis Cluster connection ' ,
316+ );
317+ }
301318}
0 commit comments