| Total Complexity | 7 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class TestKernel extends CoreKernel |
||
| 11 | { |
||
| 12 | |||
| 13 | /** @var string[] $ciLibs */ |
||
| 14 | private $ciLibs = []; |
||
| 15 | |||
| 16 | |||
| 17 | public function __construct($basePath) |
||
| 18 | { |
||
| 19 | $this->setEnvironment(self::DEV); |
||
| 20 | parent::__construct($basePath); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Reset kernel between tests. |
||
| 25 | * Note: this avoids resetting services (See TestState for service specific reset) |
||
| 26 | * |
||
| 27 | * @return $this |
||
| 28 | */ |
||
| 29 | public function reset() |
||
| 30 | { |
||
| 31 | $this->setEnvironment(self::DEV); |
||
| 32 | $this->bootPHP(); |
||
| 33 | return $this; |
||
| 34 | } |
||
| 35 | |||
| 36 | protected function bootPHP() |
||
| 37 | { |
||
| 38 | parent::bootPHP(); |
||
| 39 | |||
| 40 | // Set default timezone consistently to avoid NZ-specific dependencies |
||
| 41 | date_default_timezone_set('UTC'); |
||
| 42 | } |
||
| 43 | |||
| 44 | protected function getIncludeTests() |
||
| 45 | { |
||
| 46 | return true; |
||
| 47 | } |
||
| 48 | |||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string[] $ciLibs |
||
| 52 | */ |
||
| 53 | public function setIgnoreCILibraries(array $ciLibs): self |
||
| 54 | { |
||
| 55 | $this->ciLibs = $ciLibs; |
||
| 56 | return $this; |
||
| 57 | } |
||
| 58 | |||
| 59 | protected function getIgnoreCILibraries(): array |
||
| 62 | } |
||
| 63 | |||
| 64 | protected function bootErrorHandling() |
||
| 68 | } |
||
| 69 | } |
||
| 70 |