Conditions | 4 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4.0119 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 427 | public static function _setUpFactories(): void |
|
21 | { |
||
22 | 427 | if (!\is_subclass_of(static::class, KernelTestCase::class)) { |
|
23 | throw new \RuntimeException(\sprintf('The "%s" trait can only be used on TestCases that extend "%s".', __TRAIT__, KernelTestCase::class)); |
||
24 | } |
||
25 | |||
26 | 427 | if (!static::$booted) { |
|
27 | 427 | static::bootKernel(); |
|
28 | } |
||
29 | |||
30 | 427 | TestState::bootFromContainer(static::$kernel->getContainer())->setManagerRegistry( |
|
31 | new LazyManagerRegistry(static function() { |
||
32 | 205 | if (!static::$booted) { |
|
33 | 205 | static::bootKernel(); |
|
34 | } |
||
35 | |||
36 | 205 | return static::$kernel->getContainer()->get('doctrine'); |
|
37 | 427 | }) |
|
38 | ); |
||
39 | |||
40 | 427 | self::ensureKernelShutdown(); |
|
41 | 427 | } |
|
53 |