Skip to content

Commit 66ed979

Browse files
authored
Merge pull request #228 from fbourigault/feature/symfony4
Add Symfony 4 support
2 parents d12c15d + 1d35357 commit 66ed979

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

Tests/Resources/app/AppKernel.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
44
use Symfony\Component\Config\Loader\LoaderInterface;
5+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
56
use Symfony\Component\DependencyInjection\ContainerBuilder;
67
use Symfony\Component\HttpFoundation\Response;
78
use Symfony\Component\HttpKernel\Kernel;
@@ -86,4 +87,43 @@ public function indexAction()
8687
{
8788
return new Response();
8889
}
90+
91+
protected function build(ContainerBuilder $container)
92+
{
93+
$container->addCompilerPass(new PublicServicesForFunctionalTestsPass());
94+
}
95+
}
96+
97+
class PublicServicesForFunctionalTestsPass implements CompilerPassInterface
98+
{
99+
public function process(ContainerBuilder $container)
100+
{
101+
$services = [
102+
'httplug.strategy',
103+
'httplug.auto_discovery.auto_discovered_client',
104+
'httplug.auto_discovery.auto_discovered_async',
105+
'httplug.message_factory.default',
106+
'httplug.stream_factory.default',
107+
'httplug.uri_factory.default',
108+
'httplug.async_client.default',
109+
'httplug.client.default',
110+
'app.http.plugin.custom',
111+
'httplug.client.acme',
112+
];
113+
foreach ($services as $service) {
114+
if ($container->hasDefinition($service)) {
115+
$container->getDefinition($service)->setPublic(true);
116+
}
117+
118+
}
119+
120+
$aliases = [
121+
'httplug.client',
122+
];
123+
foreach ($aliases as $alias) {
124+
if ($container->hasAlias($alias)) {
125+
$container->getAlias($alias)->setPublic(true);
126+
}
127+
}
128+
}
89129
}

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"php-http/cache-plugin": "^1.4",
2424
"php-http/logger-plugin": "^1.0",
2525
"php-http/stopwatch-plugin": "^1.0",
26-
"symfony/options-resolver": "^2.8 || ^3.0",
27-
"symfony/event-dispatcher": "^2.8 || ^3.0",
28-
"symfony/framework-bundle": "^2.8 || ^3.0",
26+
"symfony/options-resolver": "^2.8 || ^3.0 || ^4.0",
27+
"symfony/event-dispatcher": "^2.8 || ^3.0 || ^4.0",
28+
"symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0",
2929
"php-http/message": "^1.4",
3030
"php-http/discovery": "^1.0",
3131
"twig/twig": "^1.18 || ^2.0",
32-
"symfony/asset": "^2.8 || ^3.0",
33-
"symfony/dependency-injection": "^2.8.3 || ^3.0.3"
32+
"symfony/asset": "^2.8 || ^3.0 || ^4.0",
33+
"symfony/dependency-injection": "^2.8.3 || ^3.0.3 || ^4.0"
3434
},
3535
"require-dev": {
3636
"phpunit/php-token-stream": "^1.1.8",
@@ -41,13 +41,13 @@
4141
"php-http/buzz-adapter": "^0.3",
4242
"php-http/mock-client": "^1.0",
4343
"symfony/phpunit-bridge": "^3.3 || ^4.0",
44-
"symfony/twig-bundle": "^2.8 || ^3.0",
45-
"symfony/twig-bridge": "^2.8 || ^3.0",
46-
"symfony/web-profiler-bundle": "^2.8 || ^3.0",
47-
"symfony/finder": "^2.7 || ^3.0",
48-
"symfony/cache": "^3.1",
49-
"symfony/browser-kit": "^2.8 || ^3.0",
50-
"symfony/dom-crawler": "^2.8 || ^3.0",
44+
"symfony/twig-bundle": "^2.8 || ^3.0 || ^4.0",
45+
"symfony/twig-bridge": "^2.8 || ^3.0 || ^4.0",
46+
"symfony/web-profiler-bundle": "^2.8 || ^3.0 || ^4.0",
47+
"symfony/finder": "^2.7 || ^3.0 || ^4.0",
48+
"symfony/cache": "^3.1 || ^4.0",
49+
"symfony/browser-kit": "^2.8 || ^3.0 || ^4.0",
50+
"symfony/dom-crawler": "^2.8 || ^3.0 || ^4.0",
5151
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
5252
"matthiasnoback/symfony-dependency-injection-test": "^1.1 || ^2.0",
5353
"nyholm/nsa": "^1.1"

0 commit comments

Comments
 (0)