@@ -392,7 +392,7 @@ public function testActivateWithEmptyUserID()
392392 // Verify that sendImpressionEvent is called with expected attributes
393393 $ optimizelyMock ->expects ($ this ->exactly (1 ))
394394 ->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 );
396396
397397 // Call activate
398398 $ this ->assertEquals ('variation ' , $ optimizelyMock ->activate ('test_experiment ' , '' , $ userAttributes ));
@@ -487,7 +487,7 @@ public function testActivateNoAudienceNoAttributes()
487487 // Verify that sendImpression is called with expected params
488488 $ optimizelyMock ->expects ($ this ->exactly (1 ))
489489 ->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 );
491491
492492 // Call activate
493493 $ this ->assertSame ('group_exp_1_var_2 ' , $ optimizelyMock ->activate ('group_experiment_1 ' , 'user_1 ' ));
@@ -520,7 +520,7 @@ public function testActivateNoAudienceNoAttributesAfterSetForcedVariation()
520520 // Verify that sendImpression is called with expected params
521521 $ optimizelyMock ->expects ($ this ->exactly (1 ))
522522 ->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 );
524524
525525 // set forced variation
526526 $ this ->assertTrue ($ optimizelyMock ->setForcedVariation ($ experimentKey , $ userId , $ variationKey ), 'Set variation for paused experiment should have failed. ' );
@@ -581,7 +581,7 @@ public function testActivateWithAttributes()
581581 // Verify that sendImpressionEvent is called with expected attributes
582582 $ optimizelyMock ->expects ($ this ->exactly (1 ))
583583 ->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 );
585585
586586 // Call activate
587587 $ this ->assertEquals ('control ' , $ optimizelyMock ->activate ('test_experiment ' , 'test_user ' , $ userAttributes ));
@@ -614,7 +614,7 @@ public function testActivateWithAttributesOfDifferentTypes()
614614 // Verify that sendImpressionEvent is called with expected attributes
615615 $ optimizelyMock ->expects ($ this ->exactly (1 ))
616616 ->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 );
618618
619619 // Call activate
620620 $ this ->assertEquals ('control ' , $ optimizelyMock ->activate ('test_experiment ' , 'test_user ' , $ userAttributes ));
@@ -639,7 +639,7 @@ public function testActivateWithAttributesTypedAudienceMatch()
639639 // Verify that sendImpressionEvent is called with expected attributes
640640 $ optimizelyMock ->expects ($ this ->at (0 ))
641641 ->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 );
643643
644644 // Should be included via exact match string audience with id '3468206642'
645645 $ this ->assertEquals ('A ' , $ optimizelyMock ->activate ('typed_audience_experiment ' , 'test_user ' , $ userAttributes ));
@@ -651,7 +651,7 @@ public function testActivateWithAttributesTypedAudienceMatch()
651651 // Verify that sendImpressionEvent is called with expected attributes
652652 $ optimizelyMock ->expects ($ this ->at (0 ))
653653 ->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 );
655655
656656 //Should be included via exact match number audience with id '3468206646'
657657 $ this ->assertEquals ('A ' , $ optimizelyMock ->activate ('typed_audience_experiment ' , 'test_user ' , $ userAttributes ));
@@ -691,7 +691,7 @@ public function testActivateWithAttributesComplexAudienceMatch()
691691 // Verify that sendImpressionEvent is called once with expected attributes
692692 $ optimizelyMock ->expects ($ this ->exactly (1 ))
693693 ->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 );
695695
696696 // Should be included via substring match string audience with id '3988293898', and
697697 // exact match number audience with id '3468206646'
@@ -2554,7 +2554,7 @@ public function testIsFeatureEnabledGivenFeatureExperimentAndFeatureEnabledIsTru
25542554 // assert that sendImpressionEvent is called with expected params
25552555 $ optimizelyMock ->expects ($ this ->exactly (1 ))
25562556 ->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 ' , []);
25582558
25592559 $ this ->loggerMock ->expects ($ this ->at (0 ))
25602560 ->method ('log ' )
@@ -2659,7 +2659,7 @@ public function testIsFeatureEnabledGivenFeatureExperimentAndFeatureEnabledIsFal
26592659
26602660 $ optimizelyMock ->expects ($ this ->exactly (1 ))
26612661 ->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 ' , []);
26632663
26642664 $ this ->loggerMock ->expects ($ this ->at (0 ))
26652665 ->method ('log ' )
@@ -3042,7 +3042,7 @@ public function testIsFeatureEnabledWithEmptyUserID()
30423042 // assert that sendImpressionEvent is called with expected params
30433043 $ optimizelyMock ->expects ($ this ->exactly (1 ))
30443044 ->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 , '' , []);
30463046
30473047 $ this ->loggerMock ->expects ($ this ->at (0 ))
30483048 ->method ('log ' )
@@ -4682,6 +4682,7 @@ public function testSendImpressionEventWithNoAttributes()
46824682 'group_experiment_1 ' ,
46834683 'group_experiment_1 ' ,
46844684 'experiment ' ,
4685+ true ,
46854686 'user_1 ' ,
46864687 null
46874688 )
@@ -4734,7 +4735,7 @@ public function testSendImpressionEventWithNoAttributes()
47344735 'Dispatching impression event to URL logx.optimizely.com/decision with params {"param1":"val1","param2":"val2"}. '
47354736 );
47364737
4737- $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , 'group_experiment_1 ' , 'group_experiment_1 ' , 'experiment ' , 'user_1 ' , null );
4738+ $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'group_experiment_1 ' , 'group_exp_1_var_2 ' , 'group_experiment_1 ' , 'group_experiment_1 ' , 'experiment ' , true , 'user_1 ' , null );
47384739 }
47394740
47404741 public function testSendImpressionEventDispatchFailure ()
@@ -4757,7 +4758,7 @@ public function testSendImpressionEventDispatchFailure()
47574758 ->method ('log ' )
47584759 ->with (Logger::ERROR , 'Unable to dispatch impression event. Error ' );
47594760
4760- $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , 'test_user ' , []);
4761+ $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , true , 'test_user ' , []);
47614762 }
47624763
47634764 public function testSendImpressionEventWithAttributes ()
@@ -4780,6 +4781,7 @@ public function testSendImpressionEventWithAttributes()
47804781 'test_experiment ' ,
47814782 'test_experiment ' ,
47824783 'experiment ' ,
4784+ true ,
47834785 'test_user ' ,
47844786 $ userAttributes
47854787 )
@@ -4822,7 +4824,7 @@ public function testSendImpressionEventWithAttributes()
48224824
48234825 $ optlyObject ->notificationCenter = $ this ->notificationCenterMock ;
48244826
4825- $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , 'test_user ' , $ userAttributes );
4827+ $ optlyObject ->sendImpressionEvent ($ this ->projectConfig , 'test_experiment ' , 'control ' , 'test_experiment ' , 'test_experiment ' , 'experiment ' , true , 'test_user ' , $ userAttributes );
48264828 }
48274829
48284830 /*
@@ -4998,7 +5000,7 @@ public function testRolloutSendImpressionWhenSendFlagDecisionFlagInDatafile()
49985000 // Verify that sendImpressionEvent is called with expected attributes
49995001 $ optimizelyMock ->expects ($ this ->exactly (1 ))
50005002 ->method ('sendImpressionEvent ' )
5001- ->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 ' , true , 'user_id ' , []);
50025004
50035005 $ this ->assertTrue ($ optimizelyMock ->isFeatureEnabled ('boolean_single_variable_feature ' , 'user_id ' , []));
50045006 }
0 commit comments