-
Notifications
You must be signed in to change notification settings - Fork 50
Add Symfony 4 support #228
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
Conversation
@@ -297,6 +298,7 @@ private function configureClient(ContainerBuilder $container, $clientName, array | |||
|
|||
$container | |||
->register($serviceId, PluginClient::class) | |||
->setPublic(true) |
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.
How can we avoid to set this one public just for tests?
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.
Psudo code:
$services = $container->getAllServiceDefinitionKeys()
foreach ($services as $service) {
if ($service->getId() matches "httplug.client.*") {
$container->getDefinition($service)->setPublic(true);
}
}
I do not know any better... sorry
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.
Btw, will the tests fail if we remove this line?
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.
if we keep the compiler pass, this line can be reverted, right?
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.
i am not perfectly happy with this. but if there is no simple way to test on the container builder instead, i'd say lets merge this
Tests/Resources/app/AppKernel.php
Outdated
]; | ||
foreach ($services as $service) { | ||
if ($container->hasDefinition($service)) { | ||
$container->getDefinition($service)->setPublic(true); |
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.
this could be quite confusing when reading the tests, or when creating a new test. is there any chance we can instead have our tests operate on the container builder instead of the closed container?
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.
Yes, that's the idea but it's too many work ATM.
@@ -297,6 +298,7 @@ private function configureClient(ContainerBuilder $container, $clientName, array | |||
|
|||
$container | |||
->register($serviceId, PluginClient::class) | |||
->setPublic(true) |
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.
if we keep the compiler pass, this line can be reverted, right?
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.
Make sure to merge with with a merge commit
We are still waiting for matthiasnoback/symfony-dependency-injection-test and php-http/stopwatch-plugin to really test against Symfony 4 only components. |
@@ -50,7 +51,7 @@ public function load(array $configs, ContainerBuilder $container) | |||
|
|||
// Set main aliases | |||
foreach ($config['main_alias'] as $type => $id) { | |||
$container->setAlias(sprintf('httplug.%s', $type), $id); | |||
$container->setAlias(sprintf('httplug.%s', $type), new Alias($id, true)); |
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.
the changes in this file should then be reverted too
I removed the public aliases. |
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.
Thank you
This is #211 with a hack to get services private in Symfony 4 without rewriting a large part of tests.
I fixedup @dbrumann commits and added mine to get @dbrumann credited.
Close #211. Close #218.
The
PublicServicesForFunctionalTestsPass
is a hack and we must rewrite tests to remove this in the future.