-
Notifications
You must be signed in to change notification settings - Fork 67
case-insensitive for Operator name #93
base: master
Are you sure you want to change the base?
Conversation
Test/Integration/Model/Operator.php
Outdated
@@ -204,4 +204,30 @@ function ($b) use (&$gExecuted) { | |||
->boolean($gExecuted) | |||
->isTrue(); | |||
} | |||
|
|||
public function case_insensitive() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure we can write unit test cases here. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is that we do not require an integration test case to check that Asserter::$_operators
has change operator's name cases. This is a typical case of a unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true, but this case also cover the visitor rule are as expected, not only how operator are stored.
You think these three test are bit overkill?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You only need to test the asserter visitor. Why do you want to test something else?
@Hywan Unit Test like this ? |
Test/Unit/Visitor/Asserter.php
Outdated
) | ||
->when($result = $asserter->setOperator('_FOO_', $operator)) | ||
->then | ||
->boolean($asserter->operatorExists('_foo_')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also check that _FOO_
does not exist.
@Pierozi It looks good modulo my comment 👍. |
9f10a86
to
e6bea82
Compare
Done 👍 |
I am assigning @jubianchi for the review! |
Quick review ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getter should ony change the case.
Also, in the Operator
constructor, we must change the case there, instead of when instanciating the Operator
class.
{ | ||
$this | ||
->given( | ||
$asserter = new SUT(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, run hoa devtools:cs
, and simply align =
.
@@ -418,6 +418,23 @@ public function case_set_operator() | |||
->isEqualTo(xcallable($operator)); | |||
} | |||
|
|||
public function case_set_operator_insensitive() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test operator case-insensitive Complete Unit for operator case-insensitive
4ca678a
to
388e75e
Compare
2 similar comments
It seems casting of Extended ASCII work only from php >= 5.6 as Travis build report. |
@Pierozi In this case, I propose to wait on PHP 7 to land in Hoa to merge this PR. It will come really soon. Agree? |
Address to #92Fix #92.
Edit by @Hywan.