1
1
<?php
2
2
/**
3
- * Copyright 2016-2017 , Optimizely
3
+ * Copyright 2016-2018 , Optimizely
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
@@ -107,8 +107,7 @@ public function testBucketValidExperimentNotInGroup()
107
107
->method ('log ' )
108
108
->with (Logger::INFO , 'User "testUserId" is in no variation. ' );
109
109
110
- $ this ->assertEquals (
111
- new Variation (),
110
+ $ this ->assertNull (
112
111
$ bucketer ->bucket (
113
112
$ this ->config ,
114
113
$ this ->config ->getExperimentFromKey ('test_experiment ' ),
@@ -167,8 +166,7 @@ public function testBucketValidExperimentNotInGroup()
167
166
->method ('log ' )
168
167
->with (Logger::INFO , 'User "testUserId" is in no variation. ' );
169
168
170
- $ this ->assertEquals (
171
- new Variation (),
169
+ $ this ->assertNull (
172
170
$ bucketer ->bucket (
173
171
$ this ->config ,
174
172
$ this ->config ->getExperimentFromKey ('test_experiment ' ),
@@ -271,8 +269,7 @@ public function testBucketValidExperimentInGroup()
271
269
->method ('log ' )
272
270
->with (Logger::INFO , 'User "testUserId" is not in experiment group_experiment_1 of group 7722400015. ' );
273
271
274
- $ this ->assertEquals (
275
- new Variation (),
272
+ $ this ->assertNull (
276
273
$ bucketer ->bucket (
277
274
$ this ->config ,
278
275
$ this ->config ->getExperimentFromKey ('group_experiment_1 ' ),
@@ -290,8 +287,7 @@ public function testBucketValidExperimentInGroup()
290
287
->method ('log ' )
291
288
->with (Logger::INFO , 'User "testUserId" is in no experiment. ' );
292
289
293
- $ this ->assertEquals (
294
- new Variation (),
290
+ $ this ->assertNull (
295
291
$ bucketer ->bucket (
296
292
$ this ->config ,
297
293
$ this ->config ->getExperimentFromKey ('group_experiment_1 ' ),
@@ -308,8 +304,7 @@ public function testBucketValidExperimentInGroup()
308
304
$ this ->loggerMock ->expects ($ this ->at (1 ))
309
305
->method ('log ' )
310
306
->with (Logger::INFO , 'User "testUserId" is in no experiment. ' );
311
- $ this ->assertEquals (
312
- new Variation (),
307
+ $ this ->assertNull (
313
308
$ bucketer ->bucket (
314
309
$ this ->config ,
315
310
$ this ->config ->getExperimentFromKey ('group_experiment_1 ' ),
@@ -325,8 +320,7 @@ public function testBucketInvalidExperiment()
325
320
$ this ->loggerMock ->expects ($ this ->never ())
326
321
->method ('log ' );
327
322
328
- $ this ->assertEquals (
329
- new Variation (),
323
+ $ this ->assertNull (
330
324
$ bucketer ->bucket ($ this ->config , new Experiment (), $ this ->testBucketingIdControl , $ this ->testUserId )
331
325
);
332
326
}
@@ -356,8 +350,7 @@ public function testBucketVariationInvalidExperimentsWithBucketingId()
356
350
$ bucketer = new TestBucketer ($ this ->loggerMock );
357
351
$ bucketer ->setBucketValues ([1000 , 3000 , 7000 , 9000 ]);
358
352
359
- $ this ->assertEquals (
360
- new Variation (),
353
+ $ this ->assertNull (
361
354
$ bucketer ->bucket (
362
355
$ this ->config ,
363
356
$ this ->config ->getExperimentFromKey ('invalid_experiment ' ),
@@ -430,8 +423,7 @@ public function testBucketWithRolloutRule()
430
423
)
431
424
);
432
425
433
- $ this ->assertEquals (
434
- new Variation (),
426
+ $ this ->assertNull (
435
427
$ bucketer ->bucket (
436
428
$ this ->config ,
437
429
$ rollout_rule ,
0 commit comments