Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Mockery::equalsStringIgnoringWhitespace() matcher #400

wants to merge 1 commit into from

Conversation

sk-sparhandy
Copy link

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.

@aik099
Copy link

aik099 commented Dec 12, 2014

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));
}
}
Copy link
Contributor

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.

@sk-sparhandy
Copy link
Author

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

@GrahamCampbell
Copy link
Contributor

Maybe we should remove the matchers in 1.0?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.14%) when pulling 705df5c on Sparhandy:master into 4055c0e on padraic:master.

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.
@aik099
Copy link

aik099 commented Dec 12, 2014

but Hamcrest-PHP only implements the functionality of its Java version.

@sk-sparhandy , I'm not sure really. You can try sending PR there in any case.

Maybe we should remove the matchers in 1.0?

@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

@padraic
Copy link
Member

padraic commented Feb 13, 2015

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.

@padraic padraic closed this Feb 13, 2015
@aik099
Copy link

aik099 commented Feb 13, 2015

We need to place large banner in CONTRIBUTING.md saying: Issues/PR about new matchers should go directly to Hamcrest 😄

@padraic
Copy link
Member

padraic commented Feb 13, 2015

Await my next RFC :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants