Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Allow fetching private services from test clients#26499
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| */ | ||
| public function compile() | ||
| { | ||
| return $this->publicContainer->isCompiled(); |
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.
Typo?$this->publicContainer->compile();
jakzal commentedMar 12, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Looks promising! The only issue I see is that it currently requires the Edit: I guess in such scenario we can still do |
ogizanagi commentedMar 12, 2018
In my experience, this would be useful for any |
b944061 to8e1ef8fComparenicolas-grekas commentedMar 12, 2018
OK, what about the new patch? |
ogizanagi commentedMar 12, 2018
Better :) |
626b6ad tod5c7c60Comparenicolas-grekas commentedMar 13, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
PR ready. Unused private services are still removed. This is a requirement because not all private services are valid. Since they are removed, this is not an issue but a feature. Keeping a reference to all private services would be a BC break (as experienced on the test suite before handling this.) |
d5c7c60 to196e5c3Compare196e5c3 toa840809Compare… test clients (nicolas-grekas)This PR was merged into the 4.1-dev branch.Discussion----------[FrameworkBundle] Allow fetching private services from test clients| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#25814| License | MIT| Doc PR | -With this PR, `$client->getContainer()` returns a special container that gives access to private services as if they were public.Tests derived from `WebTestCase` and `KernelTestCase` can access this special container by using the new `static::$container` property.Commits-------a840809 [FrameworkBundle] Allow fetching private services from test clients
kniziol commentedMar 19, 2018
@nicolas-grekas It will be available in 3.4 version? |
nicolas-grekas commentedMar 19, 2018
that's a new feature, so for 4.1 |
umpirsky commentedMar 20, 2018
So, actual code that's being tested will still use regular container that cannot access private services, right? |
nicolas-grekas commentedMar 20, 2018
@umpirski right. |
Sincesymfony/symfony#26499 will not be partof Symfony 3.4 regrettably.
Uh oh!
There was an error while loading.Please reload this page.
With this PR,
$client->getContainer()returns a special container that gives access to private services as if they were public.Tests derived from
WebTestCaseandKernelTestCasecan access this special container by using the newstatic::$containerproperty.