Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Commit 9f10a86

Browse files
committed
Unit test operator case-insensitive
1 parent 3d3f2c8 commit 9f10a86

2 files changed

Lines changed: 16 additions & 26 deletions

File tree

Test/Integration/Model/Operator.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -204,30 +204,4 @@ 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-
}
233207
}

Test/Unit/Visitor/Asserter.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,22 @@ public function case_set_operator()
418418
->isEqualTo(xcallable($operator));
419419
}
420420

421+
public function case_set_operator_insensitive()
422+
{
423+
$this
424+
->given(
425+
$asserter = new SUT(),
426+
$operator = function () {}
427+
)
428+
->when($result = $asserter->setOperator('_FOO_', $operator))
429+
->then
430+
->boolean($asserter->operatorExists('_foo_'))
431+
->isTrue()
432+
->object($asserter->getOperator('_foo_'))
433+
->isEqualTo(xcallable($operator));
434+
435+
}
436+
421437
public function case_set_operator_overwrite()
422438
{
423439
$this

0 commit comments

Comments
 (0)