@@ -42,11 +42,23 @@ public function testIfTrueExpression()
4242 ->end ();
4343 $ this ->assertFinalizedValueIs ('new_value ' , $ test );
4444
45+ $ test = $ this ->getTestBuilder ()
46+ ->ifTrue (fn () => 1 )
47+ ->then ($ this ->returnClosure ('new_value ' ))
48+ ->end ();
49+ $ this ->assertFinalizedValueIs ('new_value ' , $ test );
50+
4551 $ test = $ this ->getTestBuilder ()
4652 ->ifTrue (fn () => false )
4753 ->then ($ this ->returnClosure ('new_value ' ))
4854 ->end ();
4955 $ this ->assertFinalizedValueIs ('value ' , $ test );
56+
57+ $ test = $ this ->getTestBuilder ()
58+ ->ifTrue (fn () => 0 )
59+ ->then ($ this ->returnClosure ('new_value ' ))
60+ ->end ();
61+ $ this ->assertFinalizedValueIs ('value ' , $ test );
5062 }
5163
5264 public function testIfFalseExpression ()
@@ -58,16 +70,28 @@ public function testIfFalseExpression()
5870 $ this ->assertFinalizedValueIs ('new_value ' , $ test , ['key ' => false ]);
5971
6072 $ test = $ this ->getTestBuilder ()
61- ->ifFalse (fn () => true )
73+ ->ifFalse (fn ($ v ) => ' value ' === $ v )
6274 ->then ($ this ->returnClosure ('new_value ' ))
6375 ->end ();
64- $ this ->assertFinalizedValueIs ('new_value ' , $ test );
76+ $ this ->assertFinalizedValueIs ('value ' , $ test );
6577
6678 $ test = $ this ->getTestBuilder ()
67- ->ifFalse (fn () => false )
79+ ->ifFalse (fn ($ v ) => 1 )
6880 ->then ($ this ->returnClosure ('new_value ' ))
6981 ->end ();
7082 $ this ->assertFinalizedValueIs ('value ' , $ test );
83+
84+ $ test = $ this ->getTestBuilder ()
85+ ->ifFalse (fn ($ v ) => 'other_value ' === $ v )
86+ ->then ($ this ->returnClosure ('new_value ' ))
87+ ->end ();
88+ $ this ->assertFinalizedValueIs ('new_value ' , $ test );
89+
90+ $ test = $ this ->getTestBuilder ()
91+ ->ifFalse (fn ($ v ) => 0 )
92+ ->then ($ this ->returnClosure ('new_value ' ))
93+ ->end ();
94+ $ this ->assertFinalizedValueIs ('new_value ' , $ test );
7195 }
7296
7397 public function testIfStringExpression ()
0 commit comments