class TestKernel extends CoreKernel

Kernel for running unit tests

Methods

__construct(string $basePath)

Create a new kernel for this application

string
getEnvironment() deprecated

Get the environment type

boot($flush = false)

No description

shutdown()

Shutdowns the kernel.

nest()

Nests this kernel, all components, and returns the nested value.

$this
activate()

Ensures this kernel is the active kernel after or during nesting

getNestedFrom()

No description

getContainer()

No description

$this
setInjectorLoader(InjectorLoader $injectorLoader)

No description

getInjectorLoader()

Get loader for injector instance

getClassLoader()

No description

$this
setClassLoader(ClassLoader $classLoader)

No description

getModuleLoader()

No description

$this
setModuleLoader(ModuleLoader $moduleLoader)

No description

$this
setEnvironment(string $environment)

Sets new environment

getConfigLoader()

No description

$this
setConfigLoader(ConfigLoader $configLoader)

No description

$this
setThemeResourceLoader(ThemeResourceLoader $themeResourceLoader)

No description

bool|null
isFlushed()

Returns whether the Kernel has been flushed on boot

$this
reset()

Reset kernel between tests.

Details

at line 12
__construct(string $basePath)

Create a new kernel for this application

Parameters

string $basePath Path to base dir for this application

in CoreKernel at line 151
string getEnvironment() deprecated

deprecated 5.0 use Director::get_environment_type() instead. Since 5.0 it should return only if kernel overrides. No checking SESSION or Environment.

Get the environment type

Return Value

string

in CoreKernel at line 183
boot($flush = false)

Parameters

$flush

in CoreKernel at line 558
shutdown()

Shutdowns the kernel.

in CoreKernel at line 562
Kernel nest()

Nests this kernel, all components, and returns the nested value.

Return Value

Kernel

in CoreKernel at line 572
$this activate()

Ensures this kernel is the active kernel after or during nesting

Return Value

$this

in CoreKernel at line 584
getNestedFrom()

in CoreKernel at line 589
Injector getContainer()

Return Value

Injector

in CoreKernel at line 594
$this setInjectorLoader(InjectorLoader $injectorLoader)

Parameters

InjectorLoader $injectorLoader

Return Value

$this

in CoreKernel at line 603
InjectorLoader getInjectorLoader()

Get loader for injector instance

Return Value

InjectorLoader

in CoreKernel at line 608
ClassLoader getClassLoader()

Return Value

ClassLoader

in CoreKernel at line 613
$this setClassLoader(ClassLoader $classLoader)

Parameters

ClassLoader $classLoader

Return Value

$this

in CoreKernel at line 619
ModuleLoader getModuleLoader()

Return Value

ModuleLoader

in CoreKernel at line 624
$this setModuleLoader(ModuleLoader $moduleLoader)

Parameters

ModuleLoader $moduleLoader

Return Value

$this

in CoreKernel at line 630
$this setEnvironment(string $environment)

Sets new environment

Parameters

string $environment

Return Value

$this

in CoreKernel at line 641
ConfigLoader getConfigLoader()

Return Value

ConfigLoader

in CoreKernel at line 646
$this setConfigLoader(ConfigLoader $configLoader)

Parameters

ConfigLoader $configLoader

Return Value

$this

in CoreKernel at line 652
ThemeResourceLoader getThemeResourceLoader()

Return Value

ThemeResourceLoader

in CoreKernel at line 657
$this setThemeResourceLoader(ThemeResourceLoader $themeResourceLoader)

Parameters

ThemeResourceLoader $themeResourceLoader

Return Value

$this

in CoreKernel at line 668
bool|null isFlushed()

Returns whether the Kernel has been flushed on boot

Return Value

bool|null null if the kernel hasn't been booted yet

at line 24
$this reset()

Reset kernel between tests.

Note: this avoids resetting services (See TestState for service specific reset)

Return Value

$this