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

Commit

Permalink
Unit test operator case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierozi committed Sep 14, 2016
1 parent 3d3f2c8 commit 9f10a86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
26 changes: 0 additions & 26 deletions Test/Integration/Model/Operator.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,30 +204,4 @@ function ($b) use (&$gExecuted) {
->boolean($gExecuted)
->isTrue();
}

public function case_insensitive()
{
$this
->given(
$ruler = new LUT(),
$asserter = $ruler->getDefaultAsserter(),
$asserter->setOperator(
'myFirstMethod',
function () { return true; }
),
$asserter->setOperator(
'mySecondMethod',
function () { return true; }
),
$asserter->setOperator(
'mythirdmethod',
function () { return true; }
),
$rule = 'myFirstMethod() and mysecondmethod() and myThirdMethod()'
)
->when($result = $ruler->assert($rule, new LUT\Context()))
->then
->boolean($result)
->isTrue();
}
}
16 changes: 16 additions & 0 deletions Test/Unit/Visitor/Asserter.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,22 @@ public function case_set_operator()
->isEqualTo(xcallable($operator));
}

public function case_set_operator_insensitive()
{
$this
->given(
$asserter = new SUT(),
$operator = function () {}
)
->when($result = $asserter->setOperator('_FOO_', $operator))
->then
->boolean($asserter->operatorExists('_foo_'))
->isTrue()
->object($asserter->getOperator('_foo_'))
->isEqualTo(xcallable($operator));

}

public function case_set_operator_overwrite()
{
$this
Expand Down

0 comments on commit 9f10a86

Please sign in to comment.