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

Feature Request: matching method from nette/tester #245

Open
f3l1x opened this issue Jan 5, 2021 · 5 comments
Open

Feature Request: matching method from nette/tester #245

f3l1x opened this issue Jan 5, 2021 · 5 comments

Comments

@f3l1x
Copy link
Member

f3l1x commented Jan 5, 2021

I find my self very useful nette/tester (Assert::matching and Assert::isMatching).

https://github.com/nette/tester/blob/55057023d08aa2e3018c21a8c40ea2b60c5ae80f/src/Framework/Assert.php#L525

Would you consider to add this kind of method to nette/utils? I can handle PR.

I know there is already Strings::match method, but I like predefined patterns.

https://github.com/nette/tester/blob/55057023d08aa2e3018c21a8c40ea2b60c5ae80f/src/Framework/Assert.php#L437-L454

WDYT?

@milo
Copy link
Member

milo commented Jan 5, 2021

Btw. I'll refactor Tester to match() & matchRe() or similar.

@f3l1x
Copy link
Member Author

f3l1x commented Jan 5, 2021

So no more isMatching('Hello %a%', 'Hello world?')?

@milo
Copy link
Member

milo commented Jan 5, 2021

No. Only split pattern matching and regexp matching to be API more clear.

@f3l1x
Copy link
Member Author

f3l1x commented Jan 6, 2021

I see. Anyway, it will be part of the nette/tester API. Does it make sense introduce something like that in nette/utils?

@dg
Copy link
Member

dg commented Jan 6, 2021

Matching is (surprisingly) quite a complex matter. Maybe it is a topic for a separate package.

Matching in Tester I don't find so ingenious, because I'm still unable to remember what each %?% means…

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

No branches or pull requests

3 participants