From 1fab617c4edd6f3f5fb69e90a21959d8fb84d535 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 27 Mar 2026 18:24:41 +0100 Subject: [PATCH 1/4] Test: improve Windows compatibility --- features/config-create.feature | 9 ++++++--- features/config-edit.feature | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/features/config-create.feature b/features/config-create.feature index f7e40018..af92e4bd 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -113,7 +113,10 @@ Feature: Create a wp-config file Given an empty directory And WP files - When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --skip-salts --extra-php < /dev/null` + Given an empty.php file: + """ + """ + When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --skip-salts --extra-php < empty.php` Then the wp-config.php file should not contain: """ define('AUTH_SALT', @@ -247,7 +250,7 @@ Feature: Create a wp-config file Given an empty directory And WP files - When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass='p@(ss){w0r?d><}"!With"DoubleQuotes'` + When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass="p@(ss){w0r?d><}\"!With\"DoubleQuotes"` Then the wp-config.php file should contain: """ define( 'DB_PASSWORD', 'p@(ss){w0r?d><}"!With"DoubleQuotes' ) @@ -263,7 +266,7 @@ Feature: Create a wp-config file Given an empty directory And WP files - When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass='my\\password'` + When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass="my\\password"` Then the wp-config.php file should contain: """ define( 'DB_PASSWORD', 'my\\\\password' ) diff --git a/features/config-edit.feature b/features/config-edit.feature index 21e86983..b2d5189b 100644 --- a/features/config-edit.feature +++ b/features/config-edit.feature @@ -3,7 +3,7 @@ Feature: Edit a wp-config file Scenario: Edit a wp-config.php file Given a WP install - When I try `EDITOR='ex -i NONE -c q!' wp config edit;` + When I try `EDITOR="ex -i NONE -c q!" wp config edit;` Then STDERR should contain: """ Warning: No changes made to wp-config.php, aborted. @@ -21,7 +21,7 @@ Feature: Edit a wp-config file Generated 'wp-custom-config.php' file. """ - When I try `EDITOR='ex -i NONE -c q!' wp config edit --config-file=wp-custom-config.php` + When I try `EDITOR="ex -i NONE -c q!" wp config edit --config-file=wp-custom-config.php` Then STDERR should contain: """ No changes made to wp-custom-config.php, aborted. From efc29fda02edd71c852c6178925fa4be3c0c04c9 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 12:36:46 +0100 Subject: [PATCH 2/4] Use curl instead of wget in tests --- features/config-create.feature | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/features/config-create.feature b/features/config-create.feature index af92e4bd..2e3a37e5 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -197,11 +197,8 @@ Feature: Create a wp-config file Then save STDOUT as {SOCKET} And STDOUT should not be empty - When I try `wget -O {RUN_DIR}/install-package-tests https://raw.githubusercontent.com/wp-cli/wp-cli-tests/main/bin/install-package-tests` - Then STDERR should contain: - """ - install-package-tests' saved - """ + When I try `curl -sS -L -o {RUN_DIR}/install-package-tests https://raw.githubusercontent.com/wp-cli/wp-cli-tests/main/bin/install-package-tests` + Then the {RUN_DIR}/install-package-tests file should exist When I run `chmod +x {RUN_DIR}/install-package-tests` Then STDERR should be empty From d8e6521a76dea1de750ac819a5b7250ef887f57d Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 16:47:10 +0100 Subject: [PATCH 3/4] slash --- features/config-create.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/config-create.feature b/features/config-create.feature index 2e3a37e5..4304721e 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -263,16 +263,16 @@ Feature: Create a wp-config file Given an empty directory And WP files - When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass="my\\password"` + When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass="my\password"` Then the wp-config.php file should contain: """ - define( 'DB_PASSWORD', 'my\\\\password' ) + define( 'DB_PASSWORD', 'my\\password' ) """ When I run `wp config get DB_PASSWORD` Then STDOUT should be: """ - my\\password + my\password """ Scenario: wp-config.php in parent folder should not prevent config create in subfolder From 6a59145458adcd80bf00814b471c982fcc41a295 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 16:57:55 +0100 Subject: [PATCH 4/4] Apply suggestion from @swissspidy --- features/config-create.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/config-create.feature b/features/config-create.feature index 4304721e..c93bb604 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -113,7 +113,7 @@ Feature: Create a wp-config file Given an empty directory And WP files - Given an empty.php file: + And an empty.php file: """ """ When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --skip-salts --extra-php < empty.php`