Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions features/config-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
And 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',
Expand Down Expand Up @@ -194,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
Expand Down Expand Up @@ -247,7 +247,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' )
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions features/config-edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Loading