Skip to content

Commit c97df89

Browse files
authored
Merge pull request #94 from wp-cli/add/db-settings-as-variables
2 parents 1a64913 + 8f3bc77 commit c97df89

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class FeatureContext extends BehatContext implements ClosuredContextInterface {
144144
private $running_procs = array();
145145

146146
/**
147-
* Array of variables available as {VARIABLE_NAME}. Some are always set: CORE_CONFIG_SETTINGS, SRC_DIR, CACHE_DIR, WP_VERSION-version-latest.
147+
* Array of variables available as {VARIABLE_NAME}. Some are always set: CORE_CONFIG_SETTINGS, DB_USER, DB_PASSWORD, DB_HOST, SRC_DIR, CACHE_DIR, WP_VERSION-version-latest.
148148
* Some are step-dependent: RUN_DIR, SUITE_CACHE_DIR, COMPOSER_LOCAL_REPOSITORY, PHAR_PATH. One is set on use: INVOKE_WP_CLI_WITH_PHP_ARGS-args.
149149
* Scenarios can define their own variables using "Given save" steps. Variables are reset for each scenario.
150150
*/
@@ -485,6 +485,9 @@ public function __construct( array $parameters ) {
485485

486486
$this->drop_db();
487487
$this->set_cache_dir();
488+
$this->variables['DB_USER'] = self::$db_settings['dbuser'];
489+
$this->variables['DB_PASSWORD'] = self::$db_settings['dbpass'];
490+
$this->variables['DB_HOST'] = self::$db_settings['dbhost'];
488491
$this->variables['CORE_CONFIG_SETTINGS'] = Utils\assoc_args_to_str( self::$db_settings );
489492
}
490493

0 commit comments

Comments
 (0)