class TestKernel extends CoreKernel (View source)

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.

setIgnoredCIConfigs(array $ciConfigs)

Set a list of CI configurations that should cause a module's test not to be added to a manifest

Details

__construct(string $basePath)

Create a new kernel for this application

Parameters

string $basePath

Path to base dir for this application

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

boot($flush = false)

Parameters

$flush

shutdown()

Shutdowns the kernel.

Kernel nest()

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

Return Value

Kernel

$this activate()

Ensures this kernel is the active kernel after or during nesting

Return Value

$this

getNestedFrom()

Injector getContainer()

Return Value

Injector

$this setInjectorLoader(InjectorLoader $injectorLoader)

Parameters

InjectorLoader $injectorLoader

Return Value

$this

InjectorLoader getInjectorLoader()

Get loader for injector instance

Return Value

InjectorLoader

ClassLoader getClassLoader()

Return Value

ClassLoader

$this setClassLoader(ClassLoader $classLoader)

Parameters

ClassLoader $classLoader

Return Value

$this

ModuleLoader getModuleLoader()

Return Value

ModuleLoader

$this setModuleLoader(ModuleLoader $moduleLoader)

Parameters

ModuleLoader $moduleLoader

Return Value

$this

$this setEnvironment(string $environment)

Sets new environment

Parameters

string $environment

Return Value

$this

ConfigLoader getConfigLoader()

Return Value

ConfigLoader

$this setConfigLoader(ConfigLoader $configLoader)

Parameters

ConfigLoader $configLoader

Return Value

$this

ThemeResourceLoader getThemeResourceLoader()

Return Value

ThemeResourceLoader

$this setThemeResourceLoader(ThemeResourceLoader $themeResourceLoader)

Parameters

ThemeResourceLoader $themeResourceLoader

Return Value

$this

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

$this reset()

Reset kernel between tests.

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

Return Value

$this

TestKernel setIgnoredCIConfigs(array $ciConfigs)

Set a list of CI configurations that should cause a module's test not to be added to a manifest

Parameters

array $ciConfigs

Return Value

TestKernel