Configuration
in package
Table of Contents
Properties
- $defaultConfig : array<string|int, mixed>
- $defaultSuiteSettings : mixed
- $lock : mixed
- $baseDir : string
- $config : array<string|int, mixed>
- $dataDir : string
- $di : mixed
- $dir : string
- $envConfig : array<string|int, mixed>
- $envsDir : string
- $outputDir : string
- $params : mixed
- $suites : mixed
- $supportDir : string
- $testsDir : string
Methods
- append() : array<string|int, mixed>
- Adds parameters to config
- baseDir() : string
- Returns path to the base dir for config which consists with included setup Returns path to `codeception.yml` which was executed.
- config() : array<string|int, mixed>
- Loads global config file which is `codeception.yml` by default.
- dataDir() : string
- Returns current path to `_data` dir.
- envsDir() : string
- Return current path to `_envs` dir.
- isEmpty() : bool
- Is this a meta-configuration file that just points to other `codeception.yml`? If so, it may have no tests by itself.
- isExtensionEnabled() : mixed
- loadBootstrap() : mixed
- logDir() : string
- Compatibility alias to `Configuration::logDir()`
- mergeConfigs() : mixed
- modules() : array<string|int, mixed>
- Return list of enabled modules according suite config.
- outputDir() : string
- Returns actual path to current `_output` dir.
- projectDir() : string
- Returns path to the root of your project.
- suites() : mixed
- suiteSettings() : array<string|int, mixed>
- Returns suite configuration. Requires suite name and global config used (Configuration::config)
- supportDir() : string
- Return current path to `_helpers` dir.
- testsDir() : string
- Returns path to tests directory
- expandWildcardedIncludes() : array<string|int, mixed>
- Replaces wildcarded items in include array with real paths.
- expandWildcardsFor() : array<string|int, mixed>
- Finds config files in given wildcarded include path.
- getConfFromContents() : array<string|int, mixed>
- Loads configuration from Yaml data
- getConfFromFile() : array<string|int, mixed>
- Loads configuration from Yaml file or returns given value if the file doesn't exist
- loadEnvConfigs() : array<string|int, mixed>
- Loads environments configuration from set directory
- loadSuiteConfig() : array<string|int, mixed>
- Loads config from *.dist.suite.yml and *.suite.yml
- loadSuites() : mixed
- prepareParams() : mixed
Properties
$defaultConfig
public
static array<string|int, mixed>
$defaultConfig
= ['actor_suffix' => 'Tester', 'namespace' => '', 'include' => [], 'paths' => [], 'extends' => null, 'suites' => [], 'modules' => [], 'extensions' => ['enabled' => [], 'config' => [], 'commands' => []], 'reporters' => ['xml' => 'Codeception\PHPUnit\Log\JUnit', 'html' => 'Codeception\PHPUnit\ResultPrinter\HTML', 'report' => 'Codeception\PHPUnit\ResultPrinter\Report', 'tap' => 'PHPUnit\Util\Log\TAP', 'json' => 'PHPUnit\Util\Log\JSON', 'phpunit-xml' => 'Codeception\PHPUnit\Log\PhpUnit'], 'groups' => [], 'bootstrap' => false, 'settings' => ['colors' => true, 'bootstrap' => false, 'strict_xml' => false, 'lint' => true, 'backup_globals' => true, 'log_incomplete_skipped' => false, 'report_useless_tests' => false, 'disallow_test_output' => false, 'be_strict_about_changes_to_global_state' => false, 'shuffle' => false], 'coverage' => [], 'params' => [], 'gherkin' => []]
Default config
$defaultSuiteSettings
public
static mixed
$defaultSuiteSettings
= [
'actor' => null,
'class_name' => null,
// Codeception <2.3 compatibility
'modules' => ['enabled' => [], 'config' => [], 'depends' => []],
'step_decorators' => 'Codeception\Step\ConditionalAssertion',
'path' => null,
'extends' => null,
'namespace' => null,
'groups' => [],
'formats' => [],
'shuffle' => false,
'extensions' => [
// suite extensions
'enabled' => [],
'config' => [],
],
'error_level' => 'E_ALL & ~E_STRICT & ~E_DEPRECATED',
'convert_deprecations_to_exceptions' => false,
]
$lock
public
static mixed
$lock
= false
$baseDir
protected
static string
$baseDir
= null
Directory of a base configuration file for the project with includes.
Tags
$config
protected
static array<string|int, mixed>
$config
= null
Current configuration
$dataDir
protected
static string
$dataDir
= null
Current project data directory. This directory is used to hold sql dumps and other things needed for current project tests.
$di
protected
static mixed
$di
$dir
protected
static string
$dir
= null
Directory containing main configuration file.
Tags
$envConfig
protected
static array<string|int, mixed>
$envConfig
= []
environmental files configuration cache
$envsDir
protected
static string
$envsDir
= null
Directory containing environment configuration files.
$outputDir
protected
static string
$outputDir
= null
Current project output directory.
$params
protected
static mixed
$params
$suites
protected
static mixed
$suites
= []
$supportDir
protected
static string
$supportDir
= null
Directory with test support files like Actors, Helpers, PageObjects, etc
$testsDir
protected
static string
$testsDir
= null
Directory containing tests and suites of the current project.
Methods
append()
Adds parameters to config
public
static append([array<string|int, mixed> $config = [] ]) : array<string|int, mixed>
Parameters
- $config : array<string|int, mixed> = []
Return values
array<string|int, mixed>baseDir()
Returns path to the base dir for config which consists with included setup Returns path to `codeception.yml` which was executed.
public
static baseDir() : string
If config doesn't have "include" section the result is the same as projectDir()
Return values
stringconfig()
Loads global config file which is `codeception.yml` by default.
public
static config([null $configFile = null ]) : array<string|int, mixed>
When config is already loaded - returns it.
Parameters
- $configFile : null = null
Tags
Return values
array<string|int, mixed>dataDir()
Returns current path to `_data` dir.
public
static dataDir() : string
Use it to store database fixtures, sql dumps, or other files required by your tests.
Return values
stringenvsDir()
Return current path to `_envs` dir.
public
static envsDir() : string
Use it to store environment specific configuration.
Return values
stringisEmpty()
Is this a meta-configuration file that just points to other `codeception.yml`? If so, it may have no tests by itself.
public
static isEmpty() : bool
Return values
boolisExtensionEnabled()
public
static isExtensionEnabled(mixed $extensionName) : mixed
Parameters
- $extensionName : mixed
loadBootstrap()
public
static loadBootstrap(mixed $bootstrap, mixed $path) : mixed
Parameters
- $bootstrap : mixed
- $path : mixed
logDir()
Compatibility alias to `Configuration::logDir()`
public
static logDir() : string
Tags
Return values
stringmergeConfigs()
public
static mergeConfigs(mixed $a1, mixed $a2) : mixed
Parameters
- $a1 : mixed
- $a2 : mixed
modules()
Return list of enabled modules according suite config.
public
static modules(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>
-
suite settings
Return values
array<string|int, mixed>outputDir()
Returns actual path to current `_output` dir.
public
static outputDir() : string
Use it in Helpers or Groups to save result or temporary files.
Tags
Return values
stringprojectDir()
Returns path to the root of your project.
public
static projectDir() : string
Basically returns path to current codeception.yml
loaded.
Use this method instead of __DIR__
, getcwd()
or anything else.
Return values
stringsuites()
public
static suites() : mixed
suiteSettings()
Returns suite configuration. Requires suite name and global config used (Configuration::config)
public
static suiteSettings(string $suite, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
- $suite : string
- $config : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>supportDir()
Return current path to `_helpers` dir.
public
static supportDir() : string
Helpers are custom modules.
Return values
stringtestsDir()
Returns path to tests directory
public
static testsDir() : string
Return values
stringexpandWildcardedIncludes()
Replaces wildcarded items in include array with real paths.
protected
static expandWildcardedIncludes(mixed $includes) : array<string|int, mixed>
Parameters
- $includes : mixed
Tags
Return values
array<string|int, mixed>expandWildcardsFor()
Finds config files in given wildcarded include path.
protected
static expandWildcardsFor(mixed $include) : array<string|int, mixed>
Returns the expanded paths or the original if not a wildcard.
Parameters
- $include : mixed
Tags
Return values
array<string|int, mixed>getConfFromContents()
Loads configuration from Yaml data
protected
static getConfFromContents(string $contents[, string $filename = '(.yml)' ]) : array<string|int, mixed>
Parameters
- $contents : string
-
Yaml config file contents
- $filename : string = '(.yml)'
-
which is supposed to be loaded
Tags
Return values
array<string|int, mixed>getConfFromFile()
Loads configuration from Yaml file or returns given value if the file doesn't exist
protected
static getConfFromFile(string $filename[, mixed $nonExistentValue = [] ]) : array<string|int, mixed>
Parameters
- $filename : string
-
filename
- $nonExistentValue : mixed = []
-
value used if filename is not found
Tags
Return values
array<string|int, mixed>loadEnvConfigs()
Loads environments configuration from set directory
protected
static loadEnvConfigs(string $path) : array<string|int, mixed>
Parameters
- $path : string
-
path to the directory
Return values
array<string|int, mixed>loadSuiteConfig()
Loads config from *.dist.suite.yml and *.suite.yml
protected
static loadSuiteConfig(mixed $suite, mixed $path, mixed $settings) : array<string|int, mixed>
Parameters
- $suite : mixed
- $path : mixed
- $settings : mixed
Tags
Return values
array<string|int, mixed>loadSuites()
protected
static loadSuites() : mixed
prepareParams()
private
static prepareParams(mixed $settings) : mixed
Parameters
- $settings : mixed