-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add containsStringIgnoringWhiteSpace matcher #2
base: master
Are you sure you want to change the base?
Conversation
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've fixed some minor stuff. Hope you don't mind.
I don't mind @bekh6ex, thanks! |
I guess more or less. |
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.
Thanks for the changes, @bekh6ex.
*/ | ||
private function stripSpace( $string) | ||
{ | ||
return trim(preg_replace( "/\s+/", ' ', $string)); |
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.
Because this is in double quotes this technically needs to be "/\\s+/"
. But this is not critical. All the missing backslash does is creating a warning in IDEs.
*/ | ||
protected function evalSubstringOf($item) | ||
{ | ||
return (false !== strpos($this->stripSpace((string) $item), $this->stripSpace($this->_substring))); |
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.
Not that it matters much, but I find this order a bit surprising.
c6bdac3
to
b332dcb
Compare
I rebased this patch, squashed all of the tiny commits that contained nothing but fixups for previous commits, reformatted the code according to the current PHPCS rules, and finally removed most of the now obsolete comments I wrote here in the review thread (along with some by Aleksey that said nothing but "done"). I don't know if this is still needed. Please either merge this or close #1. |
This would allow to make asserts against multi-line HTML pieces, see: #1.