Skip to content

Commit

Permalink
Added functional test for DB_PASSWORD
Browse files Browse the repository at this point in the history
  • Loading branch information
UmeshSingla committed May 20, 2024
1 parent 420118c commit 0601669
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions features/config-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,12 @@ Feature: Create a wp-config file
PasswordWith'SingleQuotes'
"""
Scenario: Correct config file is generated when database password has double quote in it
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'`
Then the wp-config.php file should contain:
"""
define( 'DB_PASSWORD', 'p@(ss){w0r?d><}"!With"DoubleQuotes' )
"""
2 changes: 1 addition & 1 deletion src/Config_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public function create( $_, $assoc_args ) {
}
}
} catch ( Exception $exception ) {
//Remove the default moustache wp-config.php template file.
// Remove the default moustache wp-config.php template file.
if ( file_exists( $assoc_args['config-file'] ) ) {
unlink( $path );
}
Expand Down

0 comments on commit 0601669

Please sign in to comment.