mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #10990] Allow creating mocks of the Query class
#12742
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/10990
State: closed
Merged: Yes
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
Queryclass and intercept calls to theQuery::execute()method. The presence of the method shows us that theQueryis not a pure value object, so intercepting this kind of call might be reasonable to a certain degree.