Skip to content

Update MockFactory.php #315

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

Merged
merged 1 commit into from
Mar 5, 2019
Merged

Update MockFactory.php #315

merged 1 commit into from
Mar 5, 2019

Conversation

dbu
Copy link
Collaborator

@dbu dbu commented Feb 23, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #264
Documentation -
License MIT

What's in this PR?

Allow setting any client in the mock factory, to not break when we decorate the client for the debug toolbar.

@dbu dbu mentioned this pull request Feb 23, 2019
@dbu dbu requested review from Nyholm and xabbuh March 2, 2019 09:42
*/
public function setClient(Client $client)
public function setClient(HttpClient $client)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically a BC break.

But if I understand it correctly. Using this mock factory has never worked, right?
If so, it would mean that this is a bugfix and I'm 👍

@dbu
Copy link
Collaborator Author

dbu commented Mar 4, 2019

yes, from my understanding this never actually worked with our bundle configuration. (people might have done something with their own compiler passes, theoretically).

also, its only a BC break if you extended the factory, which would be an odd thing to do. i wonder if i should make the factory final while we are at it. (would break the same way as this bug fix already does, if somebody extended the factory). wdyt?

@joelwurtz
Copy link
Member

joelwurtz commented Mar 4, 2019

Since it's a bug it should be ok, it's only a bc break if anyone extends this factory (since a Mock Client is a HttpClient usage is still BC) so it's rather limited here, we should be fine.

Also 👍 for marking this final (and if it's too much of a BC having it as an annotation is fine also)

@dbu dbu force-pushed the allow-decorated-mock-client branch from c56dc73 to 22ad9e3 Compare March 4, 2019 16:47
@dbu dbu force-pushed the allow-decorated-mock-client branch from 22ad9e3 to 23e7913 Compare March 4, 2019 16:55
@dbu dbu merged commit 662ab9c into master Mar 5, 2019
@dbu dbu deleted the allow-decorated-mock-client branch March 5, 2019 07:48
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

Successfully merging this pull request may close these issues.

Mock client doesn't work
3 participants