Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkakkar committed Mar 11, 2024
1 parent d26faf7 commit 234c99c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/FeatureFlagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1288,11 +1288,15 @@ public function testSimpleFlag()
0 => array (
"path" => "/api/feature_flag/local_evaluation?send_cohorts&token=random_key",
"payload" => null,
"extraHeaders" => array(0 => 'User-Agent: posthog-php/3.0.3', 1 => 'Authorization: Bearer test'),
"requestOptions" => array(),
),
// no decide because local eval, but capture flag event
1 => array (
"path" => "/batch/",
'payload' => '{"batch":[{"properties":{"$feature\/simple-flag":true,"$active_feature_flags":["simple-flag"],"$feature_flag":"simple-flag","$feature_flag_response":true,"$lib":"posthog-php","$lib_version":"3.0.3","$lib_consumer":"LibCurl","$groups":[]},"distinct_id":"some-distinct-id","event":"$feature_flag_called","$groups":[],"library":"posthog-php","library_version":"3.0.3","library_consumer":"LibCurl","groups":[],"timestamp":"2022-05-01T00:00:00+00:00","type":"capture"}],"api_key":"random_key"}',
"extraHeaders" => array(0 => 'User-Agent: posthog-php/3.0.3'),
"requestOptions" => array(),
),
)
);
Expand Down Expand Up @@ -1383,6 +1387,8 @@ public function testComputingInactiveFlagLocally()
0 => array(
"path" => "/api/feature_flag/local_evaluation?send_cohorts&token=random_key",
"payload" => null,
"extraHeaders" => array(0 => 'User-Agent: posthog-php/3.0.3', 1 => 'Authorization: Bearer test'),
"requestOptions" => array(),
),
// no decide or capture calls
)
Expand Down Expand Up @@ -1416,6 +1422,8 @@ public function testFeatureFlagsLocalEvaluationForCohorts()
0 => array(
"path" => "/api/feature_flag/local_evaluation?send_cohorts&token=random_key",
"payload" => null,
"extraHeaders" => array(0 => 'User-Agent: posthog-php/3.0.3', 1 => 'Authorization: Bearer test'),
"requestOptions" => array(),
),
)
);
Expand Down Expand Up @@ -1485,6 +1493,8 @@ public function testFeatureFlagsLocalEvaluationForNegatedCohorts()
0 => array(
"path" => "/api/feature_flag/local_evaluation?send_cohorts&token=random_key",
"payload" => null,
"extraHeaders" => array(0 => 'User-Agent: posthog-php/3.0.3', 1 => 'Authorization: Bearer test'),
"requestOptions" => array(),
),
)
);
Expand Down Expand Up @@ -1526,6 +1536,8 @@ public function testFeatureFlagsLocalEvaluationForNegatedCohorts()
0 => array(
"path" => "/decide/?v=2",
'payload' => '{"api_key":"random_key","distinct_id":"some-distinct-id","person_properties":{"distinct_id":"some-distinct-id","region":"USA","other":"thing"}}',
"extraHeaders" => array(0 => 'User-Agent: posthog-php/3.0.3'),
"requestOptions" => array("timeout" => 3000, "shouldRetry" => false),
),
)
);
Expand Down

0 comments on commit 234c99c

Please sign in to comment.