This repository was archived by the owner on Sep 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -204,4 +204,30 @@ function ($b) use (&$gExecuted) {
204204 ->boolean ($ gExecuted )
205205 ->isTrue ();
206206 }
207+
208+ public function case_insensitive ()
209+ {
210+ $ this
211+ ->given (
212+ $ ruler = new LUT (),
213+ $ asserter = $ ruler ->getDefaultAsserter (),
214+ $ asserter ->setOperator (
215+ 'myFirstMethod ' ,
216+ function () { return true ; }
217+ ),
218+ $ asserter ->setOperator (
219+ 'mySecondMethod ' ,
220+ function () { return true ; }
221+ ),
222+ $ asserter ->setOperator (
223+ 'mythirdmethod ' ,
224+ function () { return true ; }
225+ ),
226+ $ rule = 'myFirstMethod() and mysecondmethod() and myThirdMethod() '
227+ )
228+ ->when ($ result = $ ruler ->assert ($ rule , new LUT \Context ()))
229+ ->then
230+ ->boolean ($ result )
231+ ->isTrue ();
232+ }
207233}
Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ public function getContext()
465465 */
466466 public function setOperator ($ operator , $ callable )
467467 {
468- $ this ->_operators [$ operator ] = $ callable ;
468+ $ this ->_operators [mb_strtolower ( $ operator) ] = $ callable ;
469469
470470 return $ this ;
471471 }
You can’t perform that action at this time.
0 commit comments