@@ -182,6 +182,18 @@ public function testBind_modifierColon_inverseLogic_beforeTokenModifier():void {
182182 self ::assertFalse ($ div ->classList ->contains ("hidden " ));
183183 }
184184
185+ public function testBind_modifierColon_inverseLogic_usesBindKeyWhenNoExplicitTokenNames ():void {
186+ $ document = new HTMLDocument (HTMLPageContent::HTML_INVERSE_MODIFIER_BINDING );
187+ $ sut = new HTMLAttributeBinder ();
188+ $ div = $ document ->getElementById ("div3 " );
189+
190+ $ sut ->bind ("show " , false , $ div );
191+ self ::assertTrue ($ div ->classList ->contains ("show " ));
192+
193+ $ sut ->bind ("show " , true , $ div );
194+ self ::assertFalse ($ div ->classList ->contains ("show " ));
195+ }
196+
185197 public function testBind_modifierColon_multipleExpressionsCanBeBundled ():void {
186198 $ document = new HTMLDocument (HTMLPageContent::HTML_MULTI_CLASS_BINDING );
187199 $ sut = new HTMLAttributeBinder ();
@@ -256,6 +268,20 @@ public function testBind_modifierQuestion_inverseLogic_beforeQuestionModifier():
256268 self ::assertFalse ($ button ->disabled );
257269 }
258270
271+ public function testGetModifierType_withoutTokenOrBooleanModifier_returnsFirstCharacter ():void {
272+ $ sut = new HTMLAttributeBinder ();
273+ $ method = new \ReflectionMethod ($ sut , "getModifierType " );
274+
275+ self ::assertSame ("! " , $ method ->invoke ($ sut , "!show " ));
276+ }
277+
278+ public function testGetModifierBody_withoutLeadingTokenOrBooleanModifier_trimsPrefixCharacter ():void {
279+ $ sut = new HTMLAttributeBinder ();
280+ $ method = new \ReflectionMethod ($ sut , "getModifierBody " );
281+
282+ self ::assertSame ("show " , $ method ->invoke ($ sut , "!show " ));
283+ }
284+
259285 public function testBind_modifierQuestion_withNullValue ():void {
260286 $ document = new HTMLDocument (HTMLPageContent::HTML_DIFFERENT_BIND_PROPERTIES );
261287 $ sut = new HTMLAttributeBinder ();
0 commit comments