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

case-insensitive for Operator name#93

Open
Pierozi wants to merge 4 commits into
hoaproject:masterfrom
Pierozi:fix/setOperatorInsensitive
Open

case-insensitive for Operator name#93
Pierozi wants to merge 4 commits into
hoaproject:masterfrom
Pierozi:fix/setOperatorInsensitive

Conversation

@Pierozi

@Pierozi Pierozi commented Sep 14, 2016

Copy link
Copy Markdown
Member

Address to #92
Fix #92.

Edit by @Hywan.

Comment thread Test/Integration/Model/Operator.php Outdated
->isTrue();
}

public function case_insensitive()

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

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?

Copy link
Copy Markdown
Member

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?

@Pierozi

Pierozi commented Sep 14, 2016

Copy link
Copy Markdown
Member Author

@Hywan Unit Test like this ?
I will rebase when it's ok.

Comment thread Test/Unit/Visitor/Asserter.php Outdated
)
->when($result = $asserter->setOperator('_FOO_', $operator))
->then
->boolean($asserter->operatorExists('_foo_'))

Copy link
Copy Markdown
Member

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.

@Hywan

Hywan commented Sep 14, 2016

Copy link
Copy Markdown
Member

@Pierozi It looks good modulo my comment 👍.

@Pierozi Pierozi force-pushed the fix/setOperatorInsensitive branch from 9f10a86 to e6bea82 Compare September 14, 2016 13:02
@Pierozi

Pierozi commented Sep 14, 2016

Copy link
Copy Markdown
Member Author

Done 👍

@Hywan Hywan assigned jubianchi and unassigned Hywan Sep 14, 2016
@Hywan

Hywan commented Sep 14, 2016

Copy link
Copy Markdown
Member

I am assigning @jubianchi for the review!

@Pierozi

Pierozi commented Jan 11, 2017

Copy link
Copy Markdown
Member Author

Quick review ?

@Hywan Hywan left a comment

Copy link
Copy Markdown
Member

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(),

Copy link
Copy Markdown
Member

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 =.

->isEqualTo(xcallable($operator));
}

public function case_set_operator_insensitive()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a case with a non-ASCII symbol, like Λ and λ (resp the capital and small variant). Is it what we want? I guess yes.

@Pierozi Pierozi assigned Pierozi and unassigned jubianchi Mar 16, 2017
@Pierozi Pierozi requested a review from jubianchi March 16, 2017 23:01
@Pierozi Pierozi force-pushed the fix/setOperatorInsensitive branch from 4ca678a to 388e75e Compare March 16, 2017 23:07
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 96.132% when pulling 388e75e on Pierozi:fix/setOperatorInsensitive into c9a965c on hoaproject:master.

2 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 96.132% when pulling 388e75e on Pierozi:fix/setOperatorInsensitive into c9a965c on hoaproject:master.

@coveralls

coveralls commented Mar 16, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 96.132% when pulling 388e75e on Pierozi:fix/setOperatorInsensitive into c9a965c on hoaproject:master.

@Pierozi

Pierozi commented Mar 16, 2017

Copy link
Copy Markdown
Member Author

It seems casting of Extended ASCII work only from php >= 5.6 as Travis build report.

@Hywan

Hywan commented Apr 6, 2017

Copy link
Copy Markdown
Member

@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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

4 participants