55namespace  League \Bundle \OAuth2ServerBundle \Tests ;
66
77use  Doctrine \DBAL \Platforms \SqlitePlatform ;
8+ use  Doctrine \ORM \Configuration  as  OrmConfiguration ;
89use  League \Bundle \OAuth2ServerBundle \Manager \AccessTokenManagerInterface ;
910use  League \Bundle \OAuth2ServerBundle \Manager \AuthorizationCodeManagerInterface ;
1011use  League \Bundle \OAuth2ServerBundle \Manager \ClientManagerInterface ;
2021
2122final  class  TestKernel extends  Kernel implements  CompilerPassInterface
2223{
23-     public  function  boot ()
24+     public  function  boot ():  void 
2425    {
2526        $ this  ->initializeEnvironmentVariables ();
2627
@@ -47,27 +48,31 @@ public function getLogDir(): string
4748        return  sprintf ('%s/tests/.kernel/logs ' , $ this  ->getProjectDir ());
4849    }
4950
50-     public  function  process (ContainerBuilder   $ container )
51+     public  function  process (ContainerBuilder   $ container ):  void 
5152    {
5253        $ this  ->exposeManagerServices ($ container );
5354    }
5455
55-     public  function  registerContainerConfiguration (LoaderInterface   $ loader )
56+     public  function  registerContainerConfiguration (LoaderInterface   $ loader ):  void 
5657    {
5758        $ loader ->load (function  (ContainerBuilder   $ container ) {
58-             $ container -> loadFromExtension ( ' doctrine ' ,  [
59+             $ doctrine =  [
5960                'dbal '  => [
60-                     'driver '  => 'sqlite ' ,
61+                     'driver '  => 'pdo_sqlite ' ,
6162                    'charset '  => 'utf8mb4 ' ,
6263                    'url '  => 'sqlite:///:memory: ' ,
6364                    'default_table_options '  => [
6465                        'charset '  => 'utf8mb4 ' ,
6566                        'utf8mb4_unicode_ci '  => 'utf8mb4_unicode_ci ' ,
6667                    ],
67-                     'platform_service '  => SqlitePlatform::class,
6868                ],
69-                 'orm '  => null ,
70-             ]);
69+             ];
70+ 
71+             if  (method_exists (OrmConfiguration::class, 'setLazyGhostObjectEnabled ' )) {
72+                 $ doctrine ['orm ' ] = ['enable_lazy_ghost_objects ' => true ];
73+             }
74+ 
75+             $ container ->loadFromExtension ('doctrine ' , $ doctrine );
7176
7277            $ container ->loadFromExtension ('framework ' , [
7378                'secret '  => 'nope ' ,
0 commit comments