-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Deprecate internal test helpers in Test namespace #39696
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
f0e48a0
to
ea48704
Compare
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.
Are those classes used by DoctrineBundle? If not, I'm 👍🏻 for internalizing them.
Just double-checked, it's not used in DoctrineBundle. |
a0c4c43
to
b6132f3
Compare
2bf25db
to
43518dd
Compare
Would it be better to do the inheritance the other way around: move all code to the new class and the old class would extend the new one with deprecation triggers? That way, in 6.0, it's just a matter of removing the old files (we would need to remove the |
@fabpot that's what we normally do, but I don't think it works in this case. The Tests directory is excluded in dist, so we would extend from an undefined class in the deprecated one. |
d5acfde
to
a174e6b
Compare
Thank you @wouterj. |
For the record, we use this helper in API Platform: https://github.com/api-platform/core/blob/main/src/Test/DoctrineOrmFilterTestCase.php#L62 If we're the only bundle using it, let's deprecate it (will find a way to do without this class, or we'll copy it), but I doubt that. |
We also using it in SonataDoctrineORMAdminBundle |
…ositoryFactory (derrabus) This PR was merged into the 6.0 branch. Discussion ---------- [DoctrineBridge] Remove DoctrineTestHelper and TestRepositoryFactory | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Follows #39696 | License | MIT | Doc PR | N/A Commits ------- 71e8815 [DoctrineBridge] Remove DoctrineTestHelper and TestRepositoryFactory
The above comments were never responded to. What is the recommended way to mock a Doctrine EntityManager if not using See, for example: |
These helper classes are only used internally in the DoctrineBridge and, as far as I can see, only make sense within the test suite of the DoctrineBridge. Having them in
Test
means they are covered by the BC promise, I think we can make our lives more easy by moving them toTests
.