File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,6 +351,18 @@ public function testMiniTernary()
351351 $ this ->assertEquals ('Pass ' , Antlers::parse ('{{ associative:one ?= "Pass" }} ' , $ this ->variables ));
352352 $ this ->assertEquals (null , Antlers::parse ('{{ missing ?= "Pass" }} ' , $ this ->variables ));
353353 $ this ->assertEquals (null , Antlers::parse ('{{ missing:thing ?= "Pass" }} ' , $ this ->variables ));
354+
355+ // Negating with !
356+ $ this ->assertEquals (null , Antlers::parse ('{{ !string ?= "Pass" }} ' , $ this ->variables ));
357+ $ this ->assertEquals (null , Antlers::parse ('{{ !associative:one ?= "Pass" }} ' , $ this ->variables ));
358+ $ this ->assertEquals ('Pass ' , Antlers::parse ('{{ !missing ?= "Pass" }} ' , $ this ->variables ));
359+ $ this ->assertEquals ('Pass ' , Antlers::parse ('{{ !missing:thing ?= "Pass" }} ' , $ this ->variables ));
360+
361+ // and with spaces
362+ $ this ->assertEquals (null , Antlers::parse ('{{ ! string ?= "Pass" }} ' , $ this ->variables ));
363+ $ this ->assertEquals (null , Antlers::parse ('{{ ! associative:one ?= "Pass" }} ' , $ this ->variables ));
364+ $ this ->assertEquals ('Pass ' , Antlers::parse ('{{ ! missing ?= "Pass" }} ' , $ this ->variables ));
365+ $ this ->assertEquals ('Pass ' , Antlers::parse ('{{ ! missing:thing ?= "Pass" }} ' , $ this ->variables ));
354366 }
355367
356368 public function testMiniTernaryInsideLoop ()
You can’t perform that action at this time.
0 commit comments