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

[FrameworkBundle] Allow setting private services with the test container #48938

Open
wants to merge 1 commit into
base: 6.3
Choose a base branch
from

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jan 10, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

This PR allows mocking a service for a test case. A typical example could be for HttpClient:

static::getContainer()->set('example.client', new MockHttpClient(...));

// do stuff that will use `example.client` and will get mock responses instead of using the network

@damienalexandre
Copy link
Contributor

damienalexandre commented Jan 10, 2023

Really looking forward this one! Thanks a lot!

@bastnic
Copy link
Contributor

bastnic commented Jan 10, 2023

Awesome!

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

4 participants