| Total Complexity | 7 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | abstract class UnitTestCase extends BaseTestCase |
||
| 13 | { |
||
| 14 | protected static bool $hasSetUpKernel = false; |
||
| 15 | |||
| 16 | protected static bool $needsKernel = false; |
||
| 17 | protected static bool $needsConfig = false; |
||
| 18 | |||
| 19 | protected static function needsKernel(): void |
||
| 20 | { |
||
| 21 | if (! self::$hasSetUpKernel) { |
||
| 22 | self::setupKernel(); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | public static function setUpBeforeClass(): void |
||
| 27 | { |
||
| 28 | if (static::$needsKernel) { |
||
| 29 | self::needsKernel(); |
||
| 30 | } |
||
| 31 | |||
| 32 | if (static::$needsConfig) { |
||
| 33 | self::mockConfig(); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | protected static function setupKernel(): void |
||
| 41 | } |
||
| 42 | |||
| 43 | protected static function mockConfig(array $items = []): void |
||
| 48 | } |
||
| 49 | } |
||
| 50 |