Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
50 | 427 | public static function _resetSchema(): void |
|
51 | { |
||
52 | 427 | if (DatabaseResetter::isDAMADoctrineTestBundleEnabled()) { |
|
53 | // not required as the DAMADoctrineTestBundle wraps each test in a transaction |
||
54 | 213 | return; |
|
55 | } |
||
56 | |||
57 | 214 | if (!\is_subclass_of(static::class, KernelTestCase::class)) { |
|
58 | throw new \RuntimeException(\sprintf('The "%s" trait can only be used on TestCases that extend "%s".', __TRAIT__, KernelTestCase::class)); |
||
59 | } |
||
60 | |||
61 | 214 | if (!static::$booted) { |
|
62 | 214 | static::bootKernel(); |
|
63 | } |
||
64 | |||
65 | 214 | DatabaseResetter::resetSchema(static::$kernel); |
|
66 | 214 | } |
|
68 |