@@ -24,7 +24,8 @@ private function getMockedLogger()
24
24
25
25
public function testRedisWithNullValues ()
26
26
{
27
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , "Wrong configuration of redis. " );
27
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
28
+ $ this ->expectExceptionMessage ("Wrong configuration of redis. " );
28
29
29
30
$ predis = new PRedis (array ());
30
31
}
@@ -107,7 +108,8 @@ public function testRedisWithParametersPrefixAndSentinels()
107
108
108
109
public function testRedisWithEmptySentinels ()
109
110
{
110
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , 'At least one sentinel is required. ' );
111
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
112
+ $ this ->expectExceptionMessage ('At least one sentinel is required. ' );
111
113
112
114
$ predis = new PRedis (array (
113
115
'sentinels ' => array (),
@@ -119,7 +121,8 @@ public function testRedisWithEmptySentinels()
119
121
120
122
public function testRedisWithSentinelsWithoutOptions ()
121
123
{
122
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , "Wrong configuration of redis. " );
124
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
125
+ $ this ->expectExceptionMessage ("Wrong configuration of redis. " );
123
126
124
127
$ predis = new PRedis (array (
125
128
'sentinels ' => array (
@@ -130,7 +133,9 @@ public function testRedisWithSentinelsWithoutOptions()
130
133
131
134
public function testRedisWithSentinelsWithoutReplicationOption ()
132
135
{
133
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , "Wrong configuration of redis. " );
136
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , );
137
+ $ this ->expectExceptionMessage ("Wrong configuration of redis. " );
138
+
134
139
$ predis = new PRedis (array (
135
140
'sentinels ' => array (
136
141
'127.0.0.1 '
@@ -146,7 +151,8 @@ public function testRedisWithSentinelsWithWrongReplicationOption()
146
151
->method ('warning ' )
147
152
->with ($ this ->equalTo ("'replication' option was deprecated please use 'distributedStrategy' " ));
148
153
149
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , "Wrong configuration of redis 'distributedStrategy'. " );
154
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
155
+ $ this ->expectExceptionMessage ("Wrong configuration of redis 'distributedStrategy'. " );
150
156
151
157
$ predis = new PRedis (array (
152
158
'sentinels ' => array (
@@ -165,10 +171,8 @@ public function testRedisWithSentinelsWithoutServiceOption()
165
171
->method ('warning ' )
166
172
->with ($ this ->equalTo ("'replication' option was deprecated please use 'distributedStrategy' " ));
167
173
168
- $ this ->expectException (
169
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
170
- 'Master name is required in replication mode for sentinel. '
171
- );
174
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
175
+ $ this ->expectExceptionMessage ('Master name is required in replication mode for sentinel. ' );
172
176
173
177
$ predis = new PRedis (array (
174
178
'sentinels ' => array (
@@ -184,7 +188,8 @@ public function testRedisWithWrongTypeOfSentinels()
184
188
{
185
189
$ logger = $ this ->getMockedLogger ();
186
190
187
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , 'sentinels must be an array. ' );
191
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,);
192
+ $ this ->expectExceptionMessage ('sentinels must be an array. ' );
188
193
189
194
$ predis = new PRedis (array (
190
195
'sentinels ' => "test " ,
@@ -196,10 +201,8 @@ public function testRedisWithWrongTypeOfSentinels()
196
201
197
202
public function testRedisSentinelWithWrongRedisDistributedStrategy ()
198
203
{
199
- $ this ->expectException (
200
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
201
- "Wrong configuration of redis 'distributedStrategy'. "
202
- );
204
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
205
+ $ this ->expectExceptionMessage ("Wrong configuration of redis 'distributedStrategy'. " );
203
206
204
207
$ predis = new PRedis (array (
205
208
'sentinels ' => array (
@@ -250,7 +253,8 @@ public function testRedisWithSentinelsAndDistributedStrategy()
250
253
251
254
public function testRedisWithEmptyClusters ()
252
255
{
253
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , 'At least one clusterNode is required. ' );
256
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
257
+ $ this ->expectExceptionMessage ('At least one clusterNode is required. ' );
254
258
255
259
$ predis = new PRedis (array (
256
260
'clusterNodes ' => array (),
@@ -263,7 +267,8 @@ public function testRedisWithEmptyClusters()
263
267
264
268
public function testRedisWithClustersWithoutOptions ()
265
269
{
266
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , "Wrong configuration of redis. " );
270
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
271
+ $ this ->expectExceptionMessage ("Wrong configuration of redis. " );
267
272
268
273
$ predis = new PRedis (array (
269
274
'clusterNodes ' => array (
@@ -274,7 +279,8 @@ public function testRedisWithClustersWithoutOptions()
274
279
275
280
public function testRedisWithWrongTypeOfClusters ()
276
281
{
277
- $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' , 'clusterNodes must be an array. ' );
282
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
283
+ $ this ->expectExceptionMessage ('clusterNodes must be an array. ' );
278
284
279
285
$ predis = new PRedis (array (
280
286
'clusterNodes ' => "test " ,
@@ -287,10 +293,8 @@ public function testRedisWithWrongTypeOfClusters()
287
293
288
294
public function testRedisClusterWithWrongRedisDistributedStrategy ()
289
295
{
290
- $ this ->expectException (
291
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
292
- "Wrong configuration of redis 'distributedStrategy'. "
293
- );
296
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
297
+ $ this ->expectExceptionMessage ("Wrong configuration of redis 'distributedStrategy'. " );
294
298
295
299
$ predis = new PRedis (array (
296
300
'clusterNodes ' => array (
@@ -304,10 +308,8 @@ public function testRedisClusterWithWrongRedisDistributedStrategy()
304
308
305
309
public function testRedisWithInvalidKeyHashtagInClusters ()
306
310
{
307
- $ this ->expectException (
308
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
309
- "keyHashTag is not valid. "
310
- );
311
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
312
+ $ this ->expectExceptionMessage ("keyHashTag is not valid. " );
311
313
312
314
$ predis = new PRedis (array (
313
315
'clusterNodes ' => array (
@@ -324,10 +326,8 @@ public function testRedisWithInvalidKeyHashtagInClusters()
324
326
325
327
public function testRedisWithInvalidBeginingKeyHashtagInClusters ()
326
328
{
327
- $ this ->expectException (
328
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
329
- "keyHashTag is not valid. "
330
- );
329
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
330
+ $ this ->expectExceptionMessage ("keyHashTag is not valid. " );
331
331
332
332
$ predis = new PRedis (array (
333
333
'clusterNodes ' => array (
@@ -344,10 +344,8 @@ public function testRedisWithInvalidBeginingKeyHashtagInClusters()
344
344
345
345
public function testRedisWithWrongTypeKeyHashtagInClusters ()
346
346
{
347
- $ this ->expectException (
348
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
349
- "keyHashTag must be string. "
350
- );
347
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
348
+ $ this ->expectExceptionMessage ("keyHashTag must be string. " );
351
349
352
350
$ predis = new PRedis (array (
353
351
'clusterNodes ' => array (
@@ -364,10 +362,8 @@ public function testRedisWithWrongTypeKeyHashtagInClusters()
364
362
365
363
public function testRedisWithWrongLengthKeyHashtagInClusters ()
366
364
{
367
- $ this ->expectException (
368
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
369
- "keyHashTag is not valid. "
370
- );
365
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
366
+ $ this ->expectExceptionMessage ("keyHashTag is not valid. " );
371
367
372
368
$ predis = new PRedis (array (
373
369
'clusterNodes ' => array (
@@ -415,10 +411,9 @@ public function testRedisWithoutCustomKeyHashtagClusters()
415
411
416
412
public function testRedisWithClustersKeyHashTags ()
417
413
{
418
- $ this ->expectException (
419
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
420
- "keyHashTags must be array. "
421
- );
414
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
415
+ $ this ->expectExceptionMessage ("keyHashTags must be an array. " );
416
+
422
417
$ predis = new PRedis (array (
423
418
'clusterNodes ' => array (
424
419
'tcp://MYIP:26379?timeout=3 '
@@ -434,10 +429,9 @@ public function testRedisWithClustersKeyHashTags()
434
429
435
430
public function testRedisWithClustersKeyHashTagsInvalid ()
436
431
{
437
- $ this ->expectException (
438
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
439
- "keyHashTags size is zero after filtering valid elements. "
440
- );
432
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
433
+ $ this ->expectExceptionMessage ("keyHashTags size is zero after filtering valid elements. " );
434
+
441
435
$ predis = new PRedis (array (
442
436
'clusterNodes ' => array (
443
437
'tcp://MYIP:26379?timeout=3 '
@@ -453,10 +447,9 @@ public function testRedisWithClustersKeyHashTagsInvalid()
453
447
454
448
public function testRedisWithClustersKeyHashTagsInvalidHashTags ()
455
449
{
456
- $ this ->expectException (
457
- 'SplitIO\Component\Cache\Storage\Exception\AdapterException ' ,
458
- "keyHashTags size is zero after filtering valid elements. "
459
- );
450
+ $ this ->expectException ('SplitIO\Component\Cache\Storage\Exception\AdapterException ' );
451
+ $ this ->expectExceptionMessage ("keyHashTags size is zero after filtering valid elements. " );
452
+
460
453
$ predis = new PRedis (array (
461
454
'clusterNodes ' => array (
462
455
'tcp://MYIP:26379?timeout=3 '
0 commit comments