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

PHPUnit constructor deprecation #176

Open
pbowyer opened this issue Jun 3, 2020 · 4 comments
Open

PHPUnit constructor deprecation #176

pbowyer opened this issue Jun 3, 2020 · 4 comments

Comments

@pbowyer
Copy link

pbowyer commented Jun 3, 2020

Using PHPUnit 9.1.5 I'm seeing this deprecation notice on every run.

Other deprecation notices (1)

  1x: The "PHPUnit\Framework\TestCase::__construct()" method is considered internal This method is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not extend it from "ApiTestCase\ApiTestCase".

I haven't got a proposed fix, I mean what you do in the constructor seems sensible 🤷‍♂️

See: sebastianbergmann/phpunit#3975

@lchrusciel
Copy link
Owner

lchrusciel commented Jun 4, 2020

Hey Peter.
Thanks for raising an issue.
Initialization of PHPMatcher there makes sense, but we may move this logic to some setup method or buildMatcher method. Should be pretty straightforward to fix.

@norberttech
Copy link
Contributor

Hey, can I ask what is the use case for MatcherFactory? In general that class is mostly for building matchers in specific order which is super important when it comes to pattern validation. However, it would be better to actually use PHPMatcher class which reduces requirement to call createMatcher and that exposes public function match($value, $pattern) : bool.

Is there maybe some use case behind MatcherFactory that I'm missing here? I'm totally open to add whatever is needed into PHPMatcher if that could help to drop MatcherFactory which is more a technical class, rather than something that should be used outside of the library.

(I know I might be digging out something old but I finally managed to find some time to properly focus on the matcher)

@lchrusciel
Copy link
Owner

Consequences of some old refactor, which provided also support for UUIDs: #149. And probably we've misused that.

@norberttech
Copy link
Contributor

yeah, matcher comes with the UUID support, I guess you might mark this property as deprecated then?

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