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

Allow creating mocks of the Query class #10990

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

derrabus
Copy link
Member

Replaces #10957.

This change allows mocking the query builder even with the native return types added in 3.0. While we do not recommend or encourage to mock the query builder, I believe we should not actively prevent this kind of test.

This change also allows us to create mocks of the Query class and intercept calls to the Query::execute() method. The presence of the method shows us that the Query is not a pure value object, so intercepting this kind of call might be reasonable to a certain degree.

@derrabus derrabus added this to the 2.17.0 milestone Oct 10, 2023
@derrabus derrabus merged commit 143ee25 into doctrine:2.17.x Oct 10, 2023
56 checks passed
@derrabus derrabus deleted the improvement/unfinal-query branch October 10, 2023 15:16
derrabus added a commit to derrabus/orm that referenced this pull request Oct 10, 2023
* 2.17.x:
  Allow creating mocks of the Query class (doctrine#10990)
  Add missing "deprecated" annotation on the annotation driver
  Deprecate EntityManager*::getPartialReference()
derrabus added a commit to derrabus/orm that referenced this pull request Oct 11, 2023
* 2.17.x:
  Allow creating mocks of the Query class (doctrine#10990)
  Add missing "deprecated" annotation on the annotation driver
  Deprecate EntityManager*::getPartialReference()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants