44
55namespace Meilisearch \Bundle \Tests ;
66
7+ use Doctrine \Bundle \DoctrineBundle \ConnectionFactory ;
78use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
89use Meilisearch \Bundle \MeilisearchBundle ;
910use Symfony \Bundle \FrameworkBundle \FrameworkBundle ;
11+ use Symfony \Bundle \FrameworkBundle \Kernel \MicroKernelTrait ;
1012use Symfony \Component \Config \Loader \LoaderInterface ;
11- use Symfony \Component \HttpKernel \ Bundle \ BundleInterface ;
13+ use Symfony \Component \DependencyInjection \ ContainerBuilder ;
1214use Symfony \Component \HttpKernel \Kernel as HttpKernel ;
1315
14- /**
15- * Class Kernel.
16- */
1716class Kernel extends HttpKernel
1817{
19- /**
20- * @return array<int, BundleInterface>
21- */
22- public function registerBundles (): array
18+ use MicroKernelTrait;
19+
20+ public function registerBundles (): iterable
2321 {
24- return [
25- new FrameworkBundle (),
26- new DoctrineBundle (),
27- new MeilisearchBundle (),
28- ];
22+ yield new FrameworkBundle ();
23+ yield new DoctrineBundle ();
24+ yield new MeilisearchBundle ();
2925 }
3026
31- public function registerContainerConfiguration ( LoaderInterface $ loader ): void
27+ protected function configureContainer ( ContainerBuilder $ container , LoaderInterface $ loader ): void
3228 {
3329 if (PHP_VERSION_ID >= 80000 ) {
3430 $ loader ->load (__DIR__ .'/config/config.yaml ' );
@@ -37,5 +33,13 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
3733 }
3834 $ loader ->load (__DIR__ .'/../config/services.xml ' );
3935 $ loader ->load (__DIR__ .'/config/meilisearch.yaml ' );
36+
37+ if (defined (ConnectionFactory::class.'::DEFAULT_SCHEME_MAP ' )) {
38+ $ container ->prependExtensionConfig ('doctrine ' , [
39+ 'orm ' => [
40+ 'report_fields_where_declared ' => true ,
41+ ],
42+ ]);
43+ }
4044 }
4145}
0 commit comments