5
5
namespace League \Bundle \OAuth2ServerBundle \Tests ;
6
6
7
7
use Doctrine \DBAL \Platforms \SqlitePlatform ;
8
+ use Doctrine \ORM \Configuration as OrmConfiguration ;
8
9
use League \Bundle \OAuth2ServerBundle \Manager \AccessTokenManagerInterface ;
9
10
use League \Bundle \OAuth2ServerBundle \Manager \AuthorizationCodeManagerInterface ;
10
11
use League \Bundle \OAuth2ServerBundle \Manager \ClientManagerInterface ;
20
21
21
22
final class TestKernel extends Kernel implements CompilerPassInterface
22
23
{
23
- public function boot ()
24
+ public function boot (): void
24
25
{
25
26
$ this ->initializeEnvironmentVariables ();
26
27
@@ -47,27 +48,31 @@ public function getLogDir(): string
47
48
return sprintf ('%s/tests/.kernel/logs ' , $ this ->getProjectDir ());
48
49
}
49
50
50
- public function process (ContainerBuilder $ container )
51
+ public function process (ContainerBuilder $ container ): void
51
52
{
52
53
$ this ->exposeManagerServices ($ container );
53
54
}
54
55
55
- public function registerContainerConfiguration (LoaderInterface $ loader )
56
+ public function registerContainerConfiguration (LoaderInterface $ loader ): void
56
57
{
57
58
$ loader ->load (function (ContainerBuilder $ container ) {
58
- $ container -> loadFromExtension ( ' doctrine ' , [
59
+ $ doctrine = [
59
60
'dbal ' => [
60
- 'driver ' => 'sqlite ' ,
61
+ 'driver ' => 'pdo_sqlite ' ,
61
62
'charset ' => 'utf8mb4 ' ,
62
63
'url ' => 'sqlite:///:memory: ' ,
63
64
'default_table_options ' => [
64
65
'charset ' => 'utf8mb4 ' ,
65
66
'utf8mb4_unicode_ci ' => 'utf8mb4_unicode_ci ' ,
66
67
],
67
- 'platform_service ' => SqlitePlatform::class,
68
68
],
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 );
71
76
72
77
$ container ->loadFromExtension ('framework ' , [
73
78
'secret ' => 'nope ' ,
0 commit comments