-
Notifications
You must be signed in to change notification settings - Fork 460
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
Mockery::equalsStringIgnoringWhitespace() matcher #400
Conversation
There is no point in adding more matchers to Mockery, when it already has integration with Hamcrest (see https://github.com/hamcrest/hamcrest-php). |
{ | ||
return mb_ereg_replace('[\\s\\n\\t]+', ' ', trim($expected)); | ||
} | ||
} |
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.
Files should end in a single new line.
@aik099 please correct me if i'm wrong, but Hamcrest-PHP only implements the functionality of its Java version. My guess was that they would not be willing to implement matchers which are not part of the Java version. Since my team uses this matcher on daily basis I thought it would be of use to others. |
Maybe we should remove the matchers in 1.0? |
EqualsStringIgnoringWhitespace() matches two strings while ignoring whitespace. This is especially usefull if you want to match multi line strings which are not indented in the same way.
@sk-sparhandy , I'm not sure really. You can try sending PR there in any case.
@GrahamCampbell we only have minimal set of them to get going. If we remove core matchers, then people would be forced to install Hamcrest. // cc: @cordoval, @davedevelopment |
Closing - see Hamcrest and perhaps include a PR there if needed. If it does not fulfil the requirements of this matcher we can revisit a solution. |
We need to place large banner in CONTRIBUTING.md saying: |
Await my next RFC :) |
EqualsStringIgnoringWhitespace() matches two strings while ignoring whitespace. This is especially useful if you want to match multi line strings which are not indented in the same way.