Skip to content

Commit 8509501

Browse files
authored
Tests: improve Windows compatibility (#217)
1 parent b29b56b commit 8509501

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

features/config-create.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ Feature: Create a wp-config file
113113
Given an empty directory
114114
And WP files
115115
116-
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --skip-salts --extra-php < /dev/null`
116+
And an empty.php file:
117+
"""
118+
"""
119+
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --skip-salts --extra-php < empty.php`
117120
Then the wp-config.php file should not contain:
118121
"""
119122
define('AUTH_SALT',
@@ -194,11 +197,8 @@ Feature: Create a wp-config file
194197
Then save STDOUT as {SOCKET}
195198
And STDOUT should not be empty
196199
197-
When I try `wget -O {RUN_DIR}/install-package-tests https://raw.githubusercontent.com/wp-cli/wp-cli-tests/main/bin/install-package-tests`
198-
Then STDERR should contain:
199-
"""
200-
install-package-tests' saved
201-
"""
200+
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`
201+
Then the {RUN_DIR}/install-package-tests file should exist
202202
203203
When I run `chmod +x {RUN_DIR}/install-package-tests`
204204
Then STDERR should be empty
@@ -247,7 +247,7 @@ Feature: Create a wp-config file
247247
Given an empty directory
248248
And WP files
249249
250-
When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass='p@(ss){w0r?d><}"!With"DoubleQuotes'`
250+
When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass="p@(ss){w0r?d><}\"!With\"DoubleQuotes"`
251251
Then the wp-config.php file should contain:
252252
"""
253253
define( 'DB_PASSWORD', 'p@(ss){w0r?d><}"!With"DoubleQuotes' )
@@ -263,16 +263,16 @@ Feature: Create a wp-config file
263263
Given an empty directory
264264
And WP files
265265
266-
When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass='my\\password'`
266+
When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass="my\password"`
267267
Then the wp-config.php file should contain:
268268
"""
269-
define( 'DB_PASSWORD', 'my\\\\password' )
269+
define( 'DB_PASSWORD', 'my\\password' )
270270
"""
271271
272272
When I run `wp config get DB_PASSWORD`
273273
Then STDOUT should be:
274274
"""
275-
my\\password
275+
my\password
276276
"""
277277
278278
Scenario: wp-config.php in parent folder should not prevent config create in subfolder

features/config-edit.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Feature: Edit a wp-config file
33
Scenario: Edit a wp-config.php file
44
Given a WP install
55

6-
When I try `EDITOR='ex -i NONE -c q!' wp config edit;`
6+
When I try `EDITOR="ex -i NONE -c q!" wp config edit;`
77
Then STDERR should contain:
88
"""
99
Warning: No changes made to wp-config.php, aborted.
@@ -21,7 +21,7 @@ Feature: Edit a wp-config file
2121
Generated 'wp-custom-config.php' file.
2222
"""
2323

24-
When I try `EDITOR='ex -i NONE -c q!' wp config edit --config-file=wp-custom-config.php`
24+
When I try `EDITOR="ex -i NONE -c q!" wp config edit --config-file=wp-custom-config.php`
2525
Then STDERR should contain:
2626
"""
2727
No changes made to wp-custom-config.php, aborted.

0 commit comments

Comments
 (0)