Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
51 | 634 | public static function _resetSchema(): void |
|
52 | { |
||
53 | 634 | if (DatabaseResetter::isDAMADoctrineTestBundleEnabled()) { |
|
54 | // not required as the DAMADoctrineTestBundle wraps each test in a transaction |
||
55 | 253 | return; |
|
56 | } |
||
57 | |||
58 | 381 | if (!\is_subclass_of(static::class, KernelTestCase::class)) { |
|
59 | throw new \RuntimeException(\sprintf('The "%s" trait can only be used on TestCases that extend "%s".', __TRAIT__, KernelTestCase::class)); |
||
60 | } |
||
61 | |||
62 | 381 | $kernel = static::createKernel(); |
|
63 | 381 | $kernel->boot(); |
|
64 | |||
65 | 381 | DatabaseResetter::resetSchema($kernel); |
|
66 | |||
67 | 381 | $kernel->shutdown(); |
|
68 | 381 | } |
|
70 |