diff --git a/features/config-create.feature b/features/config-create.feature index 85549eb5..b8152f9d 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -287,3 +287,14 @@ Feature: Create a wp-config file """ define( 'DB_USER', 'wp_cli_test_ssl' ) """ + + Scenario: Create config without WordPress bootstrap + Given an empty directory + + When I run `wp config create --skip-check --dbname=testdb --dbuser=testuser --dbpass=testpass` + Then the return code should be 0 + And STDOUT should contain: + """ + Success: Generated 'wp-config.php' file. + """ + And the wp-config.php file should exist diff --git a/src/Config_Command.php b/src/Config_Command.php index 969e1440..a6238512 100644 --- a/src/Config_Command.php +++ b/src/Config_Command.php @@ -189,6 +189,8 @@ private static function get_initial_locale() { * # Using --prompt=dbpass will prompt for the 'dbpass' argument * $ wp config create --dbname=testing --dbuser=wp --prompt=dbpass < password.txt * Success: Generated 'wp-config.php' file. + * + * @when before_wp_load */ public function create( $_, $assoc_args ) { if ( ! Utils\get_flag_value( $assoc_args, 'force' ) ) {