|
11 | 11 |
|
12 | 12 | namespace Liip\ImagineBundle\Tests\Functional\app; |
13 | 13 |
|
14 | | -use Symfony\Component\Config\Loader\LoaderInterface; |
| 14 | +use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
| 15 | +use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
15 | 16 | use Symfony\Component\HttpKernel\Kernel; |
| 17 | +use Symfony\Component\Routing\Loader\Configurator\RouteConfigurator; |
| 18 | +use Symfony\Component\Routing\RouteCollectionBuilder; |
16 | 19 |
|
17 | 20 | class AppKernel extends Kernel |
18 | 21 | { |
| 22 | + use MicroKernelTrait; |
| 23 | + |
| 24 | + private bool $enableWebp; |
| 25 | + |
| 26 | + public function __construct(string $environment, bool $debug, bool $enableWebp = false) |
| 27 | + { |
| 28 | + parent::__construct($environment, $debug); |
| 29 | + |
| 30 | + $this->enableWebp = $enableWebp; |
| 31 | + } |
| 32 | + |
19 | 33 | public function registerBundles(): iterable |
20 | 34 | { |
21 | 35 | $bundles = [ |
@@ -44,15 +58,23 @@ public function getProjectDir(): string |
44 | 58 | } |
45 | 59 |
|
46 | 60 | /** |
47 | | - * @throws \Exception |
| 61 | + * @param RouteCollectionBuilder|RouteConfigurator $routes |
48 | 62 | */ |
49 | | - public function registerContainerConfiguration(LoaderInterface $loader): void |
| 63 | + protected function configureRoutes($routes): void |
| 64 | + { |
| 65 | + $routes->import($this->getProjectDir().'/config/routing.yml'); |
| 66 | + } |
| 67 | + |
| 68 | + protected function configureContainer(ContainerConfigurator $container): void |
50 | 69 | { |
51 | 70 | if (version_compare(self::VERSION, '5.3', '>=')) { |
52 | | - $loader->load(__DIR__.'/config/symfony_5-3.yaml'); |
| 71 | + $container->import($this->getProjectDir().'/config/symfony_5-3.yaml'); |
53 | 72 | } else { |
54 | | - $loader->load(__DIR__.'/config/symfony_legacy.yaml'); |
| 73 | + $container->import($this->getProjectDir().'/config/symfony_legacy.yaml'); |
55 | 74 | } |
56 | | - $loader->load(__DIR__.'/config/config.yml'); |
| 75 | + |
| 76 | + $container->import($this->getProjectDir().'/config/config.yml'); |
| 77 | + |
| 78 | + $container->services()->alias('test.liip_imagine.service.filter', 'liip_imagine.service.filter')->public(); |
57 | 79 | } |
58 | 80 | } |
0 commit comments