Skip to content

Commit 25a7b42

Browse files
committed
Added integration test
1 parent a86d003 commit 25a7b42

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

tests/Suite/Sdk/SdkClientTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ public function testClientSemverMatchers()
316316
$this->validateLastImpression($redisClient, 'between_semver_flag', 'user1', 'off');
317317

318318
//Assertions InListSemver
319-
//
320319
$this->assertEquals('v1', $splitSdk->getTreatment('user1', 'inlist_semver_flag', array('version' => '6.7.8')));
321320
$this->validateLastImpression($redisClient, 'inlist_semver_flag', 'user1', 'v1');
322321
$this->assertEquals('v1', $splitSdk->getTreatment('user1', 'inlist_semver_flag', array('version' => '1.1.1-alpha')));
@@ -330,6 +329,10 @@ public function testClientSemverMatchers()
330329
$this->validateLastImpression($redisClient, 'inlist_semver_flag', 'user1', 'off');
331330
$this->assertEquals('off', $splitSdk->getTreatment('user1', 'inlist_semver_flag', array('version' => '8.6.0-rc.2')));
332331
$this->validateLastImpression($redisClient, 'inlist_semver_flag', 'user1', 'off');
332+
333+
// Assertions UnSupported
334+
$this->assertEquals('control', $splitSdk->getTreatment('user1', 'semver_demo_test', array('version' => '2.2.2')));
335+
$this->validateLastImpression($redisClient, 'semver_demo_test', 'user1', 'control');
333336
}
334337

335338
public function testClientWithUnsupportedMatcher()

tests/Suite/Sdk/files/splitChanges.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,50 @@
742742
]
743743
}
744744
]
745+
},
746+
{
747+
"changeNumber": 1715263640336,
748+
"trafficTypeName": "user",
749+
"name": "semver_demo_test",
750+
"trafficAllocation": 100,
751+
"trafficAllocationSeed": -109105559,
752+
"seed": 1836161355,
753+
"status": "ACTIVE",
754+
"killed": false,
755+
"defaultTreatment": "off",
756+
"algo": 2,
757+
"conditions": [
758+
{
759+
"conditionType": "WHITELIST",
760+
"matcherGroup": {
761+
"combiner": "AND",
762+
"matchers": [
763+
{
764+
"keySelector": null,
765+
"matcherType": "ALL_KEYS",
766+
"negate": false,
767+
"userDefinedSegmentMatcherData": null,
768+
"whitelistMatcherData": null,
769+
"unaryNumericMatcherData": null,
770+
"betweenMatcherData": null,
771+
"dependencyMatcherData": null,
772+
"booleanMatcherData": null,
773+
"stringMatcherData": null,
774+
"betweenStringMatcherData": null
775+
}
776+
]
777+
},
778+
"partitions": [
779+
{
780+
"treatment": "control",
781+
"size": 100
782+
}
783+
],
784+
"label": "targeting rule type unsupported by sdk"
785+
}
786+
],
787+
"configurations": {},
788+
"sets": []
745789
}
746790
],
747791
"since": -1,

0 commit comments

Comments
 (0)