Skip to content

Commit 5183df9

Browse files
g105bGreg Bowler
and
Greg Bowler
authored
When with KVP data (#309)
* ci: remove old artifacts * ci: run all php versions * feature: implement selectPrefix closes #13 * tweak: ignore unused function parameter * build: update dependencies (for gt/http compatibility) * ci: upgrade workflows, fix security issue * test: when with kvp closes #18 --------- Co-authored-by: Greg Bowler <[email protected]>
1 parent cb6780c commit 5183df9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/phpunit/Trigger/TriggerTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,28 @@ public function testWhenNotMatchesInput(Input $input):void {
2525
self::assertFalse($trigger->fire());
2626
}
2727

28+
public function testWhenWithKVP_missing():void {
29+
$sut = new Trigger(new Input([
30+
"name" => "Cody",
31+
"colour" => "orange",
32+
]));
33+
$sut->when([
34+
"colour" => "white",
35+
]);
36+
self::assertFalse($sut->fire());
37+
}
38+
39+
public function testWhenWithKVP():void {
40+
$sut = new Trigger(new Input([
41+
"name" => "Cody",
42+
"colour" => "orange",
43+
]));
44+
$sut->when([
45+
"colour" => "orange",
46+
]);
47+
self::assertTrue($sut->fire());
48+
}
49+
2850
/** @dataProvider dataInput */
2951
public function testWithSingleKey(Input $input):void {
3052
$keys = Helper::getKeysFromInput($input, 1);

0 commit comments

Comments
 (0)