|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Component\DependencyInjection\Loader\Configurator; |
| 13 | + |
| 14 | +use Symfony\Bundle\FrameworkBundle\KernelBrowser; |
| 15 | +use Symfony\Bundle\FrameworkBundle\Test\TestContainer; |
| 16 | +use Symfony\Component\BrowserKit\CookieJar; |
| 17 | +use Symfony\Component\BrowserKit\History; |
| 18 | +use Symfony\Component\DependencyInjection\ServiceLocator; |
| 19 | +use Symfony\Component\HttpKernel\EventListener\TestSessionListener; |
| 20 | + |
| 21 | +return static function (ContainerConfigurator $container) { |
| 22 | + $container->parameters()->set('test.client.parameters', []); |
| 23 | + |
| 24 | + $container->services() |
| 25 | + ->set('test.client', KernelBrowser::class) |
| 26 | + ->args([ |
| 27 | + service('kernel'), |
| 28 | + param('test.client.parameters'), |
| 29 | + service('test.client.history'), |
| 30 | + service('test.client.cookiejar'), |
| 31 | + ]) |
| 32 | + ->share(false) |
| 33 | + ->public() |
| 34 | + |
| 35 | + ->set('test.client.history', History::class)->share(false) |
| 36 | + ->set('test.client.cookiejar', CookieJar::class)->share(false) |
| 37 | + |
| 38 | + ->set('test.session.listener', TestSessionListener::class) |
| 39 | + ->args([ |
| 40 | + service_locator([ |
| 41 | + 'session' => service('session')->ignoreOnInvalid(), |
| 42 | + ]), |
| 43 | + ]) |
| 44 | + ->tag('kernel.event_subscriber') |
| 45 | + |
| 46 | + ->set('test.service_container', TestContainer::class) |
| 47 | + ->args([ |
| 48 | + service('kernel'), |
| 49 | + 'test.private_services_locator', |
| 50 | + ]) |
| 51 | + ->public() |
| 52 | + |
| 53 | + ->set('test.private_services_locator', ServiceLocator::class) |
| 54 | + ->args([abstract_arg('callable collection')]) |
| 55 | + ->public() |
| 56 | + ; |
| 57 | +}; |
0 commit comments