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 189
boot($flush = false)

Parameters

$flush

in CoreKernel at line 561
shutdown()

Shutdowns the kernel.

in CoreKernel at line 565
Kernel nest()

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

Return Value

Kernel

in CoreKernel at line 575
$this activate()

Ensures this kernel is the active kernel after or during nesting

Return Value

$this

in CoreKernel at line 587
getNestedFrom()

in CoreKernel at line 592
Injector getContainer()

Return Value

Injector

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

Parameters

InjectorLoader $injectorLoader

Return Value

$this

in CoreKernel at line 606
InjectorLoader getInjectorLoader()

Get loader for injector instance

Return Value

InjectorLoader

in CoreKernel at line 611
ClassLoader getClassLoader()

Return Value

ClassLoader

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

Parameters

ClassLoader $classLoader

Return Value

$this

in CoreKernel at line 622
ModuleLoader getModuleLoader()

Return Value

ModuleLoader

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

Parameters

ModuleLoader $moduleLoader

Return Value

$this

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

Sets new environment

Parameters

string $environment

Return Value

$this

in CoreKernel at line 644
ConfigLoader getConfigLoader()

Return Value

ConfigLoader

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

Parameters

ConfigLoader $configLoader

Return Value

$this

in CoreKernel at line 655
ThemeResourceLoader getThemeResourceLoader()

Return Value

ThemeResourceLoader

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

Parameters

ThemeResourceLoader $themeResourceLoader

Return Value

$this

in CoreKernel at line 671
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