From 39fada7c7c2154da1898e4adebaa5622f22122e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 17:32:39 +0000 Subject: [PATCH 1/3] Initial plan From e50b3c7952790dd08e9951d51cdb035a421bf313 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 17:35:44 +0000 Subject: [PATCH 2/3] Add @when before_wp_load annotation to config create command Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- src/Config_Command.php | 2 ++ 1 file changed, 2 insertions(+) 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' ) ) { From 040ea4dd596a173eb09fae54382ba0cae9ece04e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 09:56:41 +0000 Subject: [PATCH 3/3] Add Behat test for config create without WordPress bootstrap Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/config-create.feature | 11 +++++++++++ 1 file changed, 11 insertions(+) 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