-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] fix tests with Doctrine ORM 3.4+ on PHP < 8.4 #60088
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
Conversation
2d9df3d
to
521ab70
Compare
I have pushed another commit which rewrites the test a bit to no longer mess around with Doctrine ORM internals, but provide a custom repository instead which provides the results required by the test methods. |
src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
Outdated
Show resolved
Hide resolved
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.
Minor changes
src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingeIntIdEntityRepository.php
Outdated
Show resolved
Hide resolved
|
||
public function findByCustom() | ||
{ | ||
return self::$result; |
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.
Why a static property instead of a setter?
It may lead to unreproductible tests not not correctly set between test runs right?
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.
That's a valid concern and @alexandre-daubois shared the same thoughts. I rewrote the code a bit to use a public instance variable instead.
521ab70
to
9be0d0a
Compare
Thank you @xabbuh. |
The solution implemented in #59887 does no longer work on PHP < 8.4 with the changes made in doctrine/orm#11853.