Skip to content

Commit

Permalink
Test for deleting config with concatenated string
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Jun 20, 2024
1 parent 445dfd0 commit 3f02d3d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions features/config-delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,25 @@ Feature: Delete a constant or variable from the wp-config.php file
"""
Error: Found both a constant and a variable 'SOME_NAME' in the 'wp-custom-config.php' file. Use --type=<type> to disambiguate.
"""

@require-mysql
Scenario: Delete constant with concatenated strings
Given an empty directory
And WP files
And a wp-config-extra.php file:
"""
define( 'USER_PATH', '/var/www/' . get_current_user() );
"""

When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --extra-php < wp-config-extra.php`
Then the wp-config.php file should contain:
"""
'USER_PATH',
"""
When I run `wp config delete USER_PATH`
Then the wp-config.php file should not contain:
"""
'USER_PATH'
"""

0 comments on commit 3f02d3d

Please sign in to comment.