@@ -392,7 +392,7 @@ public function testActivateWithEmptyUserID()
392
392
// Verify that sendImpressionEvent is called with expected attributes
393
393
$ optimizelyMock ->expects ($ this ->exactly (1 ))
394
394
->method ('sendImpressionEvent ' )
395
- ->with ($ this ->projectConfig , 'test_experiment ' , 'variation ' , '' , 'test_experiment ' , 'experiment ' , '' , $ userAttributes );
395
+ ->with ($ this ->projectConfig , 'test_experiment ' , 'variation ' , '' , 'test_experiment ' , 'experiment ' , true , '' , $ userAttributes );
396
396
397
397
// Call activate
398
398
$ this ->assertEquals ('variation ' , $ optimizelyMock ->activate ('test_experiment ' , '' , $ userAttributes ));
@@ -487,7 +487,7 @@ public function testActivateNoAudienceNoAttributes()
487
487
// Verify that sendImpression is called with expected params
488
488
$ optimizelyMock ->expects ($ this ->exactly (1 ))
489
489
->method ('sendImpressionEvent ' )
490
- ->with ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , '' , 'group_experiment_1 ' , 'experiment ' , 'user_1 ' , null );
490
+ ->with ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , '' , 'group_experiment_1 ' , 'experiment ' , true , 'user_1 ' , null );
491
491
492
492
// Call activate
493
493
$ this ->assertSame ('group_exp_1_var_2 ' , $ optimizelyMock ->activate ('group_experiment_1 ' , 'user_1 ' ));
@@ -520,7 +520,7 @@ public function testActivateNoAudienceNoAttributesAfterSetForcedVariation()
520
520
// Verify that sendImpression is called with expected params
521
521
$ optimizelyMock ->expects ($ this ->exactly (1 ))
522
522
->method ('sendImpressionEvent ' )
523
- ->with ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , '' , 'group_experiment_1 ' , 'experiment ' , 'user_1 ' , null );
523
+ ->with ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , '' , 'group_experiment_1 ' , 'experiment ' , true , 'user_1 ' , null );
524
524
525
525
// set forced variation
526
526
$ this ->assertTrue ($ optimizelyMock ->setForcedVariation ($ experimentKey , $ userId , $ variationKey ), 'Set variation for paused experiment should have failed. ' );
@@ -581,7 +581,7 @@ public function testActivateWithAttributes()
581
581
// Verify that sendImpressionEvent is called with expected attributes
582
582
$ optimizelyMock ->expects ($ this ->exactly (1 ))
583
583
->method ('sendImpressionEvent ' )
584
- ->with ($ this ->projectConfig , 'test_experiment ' , 'control ' , '' , 'test_experiment ' , 'experiment ' , 'test_user ' , $ userAttributes );
584
+ ->with ($ this ->projectConfig , 'test_experiment ' , 'control ' , '' , 'test_experiment ' , 'experiment ' , true , 'test_user ' , $ userAttributes );
585
585
586
586
// Call activate
587
587
$ this ->assertEquals ('control ' , $ optimizelyMock ->activate ('test_experiment ' , 'test_user ' , $ userAttributes ));
@@ -614,7 +614,7 @@ public function testActivateWithAttributesOfDifferentTypes()
614
614
// Verify that sendImpressionEvent is called with expected attributes
615
615
$ optimizelyMock ->expects ($ this ->exactly (1 ))
616
616
->method ('sendImpressionEvent ' )
617
- ->with ($ this ->projectConfig , 'test_experiment ' , 'control ' , '' , 'test_experiment ' , 'experiment ' , 'test_user ' , $ userAttributes );
617
+ ->with ($ this ->projectConfig , 'test_experiment ' , 'control ' , '' , 'test_experiment ' , 'experiment ' , true , 'test_user ' , $ userAttributes );
618
618
619
619
// Call activate
620
620
$ this ->assertEquals ('control ' , $ optimizelyMock ->activate ('test_experiment ' , 'test_user ' , $ userAttributes ));
@@ -639,7 +639,7 @@ public function testActivateWithAttributesTypedAudienceMatch()
639
639
// Verify that sendImpressionEvent is called with expected attributes
640
640
$ optimizelyMock ->expects ($ this ->at (0 ))
641
641
->method ('sendImpressionEvent ' )
642
- ->with ($ this ->projectConfigForTypedAudience , 'typed_audience_experiment ' , 'A ' , '' , 'typed_audience_experiment ' , 'experiment ' , 'test_user ' , $ userAttributes );
642
+ ->with ($ this ->projectConfigForTypedAudience , 'typed_audience_experiment ' , 'A ' , '' , 'typed_audience_experiment ' , 'experiment ' , true , 'test_user ' , $ userAttributes );
643
643
644
644
// Should be included via exact match string audience with id '3468206642'
645
645
$ this ->assertEquals ('A ' , $ optimizelyMock ->activate ('typed_audience_experiment ' , 'test_user ' , $ userAttributes ));
@@ -651,7 +651,7 @@ public function testActivateWithAttributesTypedAudienceMatch()
651
651
// Verify that sendImpressionEvent is called with expected attributes
652
652
$ optimizelyMock ->expects ($ this ->at (0 ))
653
653
->method ('sendImpressionEvent ' )
654
- ->with ($ this ->projectConfigForTypedAudience , 'typed_audience_experiment ' , 'A ' , '' , 'typed_audience_experiment ' , 'experiment ' , 'test_user ' , $ userAttributes );
654
+ ->with ($ this ->projectConfigForTypedAudience , 'typed_audience_experiment ' , 'A ' , '' , 'typed_audience_experiment ' , 'experiment ' , true , 'test_user ' , $ userAttributes );
655
655
656
656
//Should be included via exact match number audience with id '3468206646'
657
657
$ this ->assertEquals ('A ' , $ optimizelyMock ->activate ('typed_audience_experiment ' , 'test_user ' , $ userAttributes ));
@@ -691,7 +691,7 @@ public function testActivateWithAttributesComplexAudienceMatch()
691
691
// Verify that sendImpressionEvent is called once with expected attributes
692
692
$ optimizelyMock ->expects ($ this ->exactly (1 ))
693
693
->method ('sendImpressionEvent ' )
694
- ->with ($ this ->projectConfigForTypedAudience , 'audience_combinations_experiment ' , 'A ' , '' , 'audience_combinations_experiment ' , 'experiment ' , 'test_user ' , $ userAttributes );
694
+ ->with ($ this ->projectConfigForTypedAudience , 'audience_combinations_experiment ' , 'A ' , '' , 'audience_combinations_experiment ' , 'experiment ' , true , 'test_user ' , $ userAttributes );
695
695
696
696
// Should be included via substring match string audience with id '3988293898', and
697
697
// exact match number audience with id '3468206646'
@@ -2554,7 +2554,7 @@ public function testIsFeatureEnabledGivenFeatureExperimentAndFeatureEnabledIsTru
2554
2554
// assert that sendImpressionEvent is called with expected params
2555
2555
$ optimizelyMock ->expects ($ this ->exactly (1 ))
2556
2556
->method ('sendImpressionEvent ' )
2557
- ->with ($ this ->projectConfig , 'test_experiment_double_feature ' , 'control ' , 'double_single_variable_feature ' , 'test_experiment_double_feature ' , FeatureDecision::DECISION_SOURCE_FEATURE_TEST , 'user_id ' , []);
2557
+ ->with ($ this ->projectConfig , 'test_experiment_double_feature ' , 'control ' , 'double_single_variable_feature ' , 'test_experiment_double_feature ' , FeatureDecision::DECISION_SOURCE_FEATURE_TEST , true , 'user_id ' , []);
2558
2558
2559
2559
$ this ->loggerMock ->expects ($ this ->at (0 ))
2560
2560
->method ('log ' )
@@ -2659,7 +2659,7 @@ public function testIsFeatureEnabledGivenFeatureExperimentAndFeatureEnabledIsFal
2659
2659
2660
2660
$ optimizelyMock ->expects ($ this ->exactly (1 ))
2661
2661
->method ('sendImpressionEvent ' )
2662
- ->with ($ this ->projectConfig , 'test_experiment_double_feature ' , 'variation ' , 'double_single_variable_feature ' , 'test_experiment_double_feature ' , FeatureDecision::DECISION_SOURCE_FEATURE_TEST , 'user_id ' , []);
2662
+ ->with ($ this ->projectConfig , 'test_experiment_double_feature ' , 'variation ' , 'double_single_variable_feature ' , 'test_experiment_double_feature ' , FeatureDecision::DECISION_SOURCE_FEATURE_TEST , false , 'user_id ' , []);
2663
2663
2664
2664
$ this ->loggerMock ->expects ($ this ->at (0 ))
2665
2665
->method ('log ' )
@@ -3042,7 +3042,7 @@ public function testIsFeatureEnabledWithEmptyUserID()
3042
3042
// assert that sendImpressionEvent is called with expected params
3043
3043
$ optimizelyMock ->expects ($ this ->exactly (1 ))
3044
3044
->method ('sendImpressionEvent ' )
3045
- ->with ($ this ->projectConfig , 'test_experiment_double_feature ' , 'control ' , 'double_single_variable_feature ' , 'test_experiment_double_feature ' , FeatureDecision::DECISION_SOURCE_FEATURE_TEST , '' , []);
3045
+ ->with ($ this ->projectConfig , 'test_experiment_double_feature ' , 'control ' , 'double_single_variable_feature ' , 'test_experiment_double_feature ' , FeatureDecision::DECISION_SOURCE_FEATURE_TEST , true , '' , []);
3046
3046
3047
3047
$ this ->loggerMock ->expects ($ this ->at (0 ))
3048
3048
->method ('log ' )
@@ -4682,9 +4682,9 @@ public function testSendImpressionEventWithNoAttributes()
4682
4682
'group_experiment_1 ' ,
4683
4683
'group_experiment_1 ' ,
4684
4684
'experiment ' ,
4685
+ true ,
4685
4686
'user_1 ' ,
4686
- null ,
4687
- true
4687
+ null
4688
4688
)
4689
4689
->willReturn (
4690
4690
new LogEvent (
@@ -4735,7 +4735,7 @@ public function testSendImpressionEventWithNoAttributes()
4735
4735
'Dispatching impression event to URL logx.optimizely.com/decision with params {"param1":"val1","param2":"val2"}. '
4736
4736
);
4737
4737
4738
- $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , 'group_experiment_1 ' , 'group_experiment_1 ' , 'experiment ' , 'user_1 ' , null , true );
4738
+ $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , 'group_experiment_1 ' , 'group_experiment_1 ' , 'experiment ' , true , 'user_1 ' , null );
4739
4739
}
4740
4740
4741
4741
public function testSendImpressionEventDispatchFailure ()
@@ -4758,7 +4758,7 @@ public function testSendImpressionEventDispatchFailure()
4758
4758
->method ('log ' )
4759
4759
->with (Logger::ERROR , 'Unable to dispatch impression event. Error ' );
4760
4760
4761
- $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , 'test_user ' , [], true );
4761
+ $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , true , 'test_user ' , []);
4762
4762
}
4763
4763
4764
4764
public function testSendImpressionEventWithAttributes ()
@@ -4781,6 +4781,7 @@ public function testSendImpressionEventWithAttributes()
4781
4781
'test_experiment ' ,
4782
4782
'test_experiment ' ,
4783
4783
'experiment ' ,
4784
+ true ,
4784
4785
'test_user ' ,
4785
4786
$ userAttributes
4786
4787
)
@@ -4823,7 +4824,7 @@ public function testSendImpressionEventWithAttributes()
4823
4824
4824
4825
$ optlyObject ->notificationCenter = $ this ->notificationCenterMock ;
4825
4826
4826
- $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , 'test_user ' , $ userAttributes, true );
4827
+ $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , true , 'test_user ' , $ userAttributes );
4827
4828
}
4828
4829
4829
4830
/*
@@ -4999,7 +5000,7 @@ public function testRolloutSendImpressionWhenSendFlagDecisionFlagInDatafile()
4999
5000
// Verify that sendImpressionEvent is called with expected attributes
5000
5001
$ optimizelyMock ->expects ($ this ->exactly (1 ))
5001
5002
->method ('sendImpressionEvent ' )
5002
- ->with ($ this ->anything (), 'rollout_1_exp_1 ' , '177771 ' , 'boolean_single_variable_feature ' , 'rollout_1_exp_1 ' , 'rollout ' , 'user_id ' , []);
5003
+ ->with ($ this ->anything (), 'rollout_1_exp_1 ' , '177771 ' , 'boolean_single_variable_feature ' , 'rollout_1_exp_1 ' , 'rollout ' , false , 'user_id ' , []);
5003
5004
5004
5005
$ this ->assertTrue ($ optimizelyMock ->isFeatureEnabled ('boolean_single_variable_feature ' , 'user_id ' , []));
5005
5006
}
0 commit comments