diff --git a/Tests/Resources/app/AppKernel.php b/Tests/Resources/app/AppKernel.php index f45dcfa0..5ed35f89 100644 --- a/Tests/Resources/app/AppKernel.php +++ b/Tests/Resources/app/AppKernel.php @@ -2,6 +2,7 @@ use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Kernel; @@ -86,4 +87,43 @@ public function indexAction() { return new Response(); } + + protected function build(ContainerBuilder $container) + { + $container->addCompilerPass(new PublicServicesForFunctionalTestsPass()); + } +} + +class PublicServicesForFunctionalTestsPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container) + { + $services = [ + 'httplug.strategy', + 'httplug.auto_discovery.auto_discovered_client', + 'httplug.auto_discovery.auto_discovered_async', + 'httplug.message_factory.default', + 'httplug.stream_factory.default', + 'httplug.uri_factory.default', + 'httplug.async_client.default', + 'httplug.client.default', + 'app.http.plugin.custom', + 'httplug.client.acme', + ]; + foreach ($services as $service) { + if ($container->hasDefinition($service)) { + $container->getDefinition($service)->setPublic(true); + } + + } + + $aliases = [ + 'httplug.client', + ]; + foreach ($aliases as $alias) { + if ($container->hasAlias($alias)) { + $container->getAlias($alias)->setPublic(true); + } + } + } } diff --git a/composer.json b/composer.json index aa4f37aa..41661bae 100644 --- a/composer.json +++ b/composer.json @@ -23,14 +23,14 @@ "php-http/cache-plugin": "^1.4", "php-http/logger-plugin": "^1.0", "php-http/stopwatch-plugin": "^1.0", - "symfony/options-resolver": "^2.8 || ^3.0", - "symfony/event-dispatcher": "^2.8 || ^3.0", - "symfony/framework-bundle": "^2.8 || ^3.0", + "symfony/options-resolver": "^2.8 || ^3.0 || ^4.0", + "symfony/event-dispatcher": "^2.8 || ^3.0 || ^4.0", + "symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0", "php-http/message": "^1.4", "php-http/discovery": "^1.0", "twig/twig": "^1.18 || ^2.0", - "symfony/asset": "^2.8 || ^3.0", - "symfony/dependency-injection": "^2.8.3 || ^3.0.3" + "symfony/asset": "^2.8 || ^3.0 || ^4.0", + "symfony/dependency-injection": "^2.8.3 || ^3.0.3 || ^4.0" }, "require-dev": { "phpunit/php-token-stream": "^1.1.8", @@ -41,13 +41,13 @@ "php-http/buzz-adapter": "^0.3", "php-http/mock-client": "^1.0", "symfony/phpunit-bridge": "^3.3 || ^4.0", - "symfony/twig-bundle": "^2.8 || ^3.0", - "symfony/twig-bridge": "^2.8 || ^3.0", - "symfony/web-profiler-bundle": "^2.8 || ^3.0", - "symfony/finder": "^2.7 || ^3.0", - "symfony/cache": "^3.1", - "symfony/browser-kit": "^2.8 || ^3.0", - "symfony/dom-crawler": "^2.8 || ^3.0", + "symfony/twig-bundle": "^2.8 || ^3.0 || ^4.0", + "symfony/twig-bridge": "^2.8 || ^3.0 || ^4.0", + "symfony/web-profiler-bundle": "^2.8 || ^3.0 || ^4.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0", + "symfony/cache": "^3.1 || ^4.0", + "symfony/browser-kit": "^2.8 || ^3.0 || ^4.0", + "symfony/dom-crawler": "^2.8 || ^3.0 || ^4.0", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "matthiasnoback/symfony-dependency-injection-test": "^1.1 || ^2.0", "nyholm/nsa": "^1.1"