Skip to content

Commit 0601669

Browse files
committed
Added functional test for DB_PASSWORD
1 parent 420118c commit 0601669

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

features/config-create.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,12 @@ Feature: Create a wp-config file
293293
PasswordWith'SingleQuotes'
294294
"""
295295
296+
Scenario: Correct config file is generated when database password has double quote in it
297+
Given an empty directory
298+
And WP files
299+
300+
When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass='p@(ss){w0r?d><}"!With"DoubleQuotes'`
301+
Then the wp-config.php file should contain:
302+
"""
303+
define( 'DB_PASSWORD', 'p@(ss){w0r?d><}"!With"DoubleQuotes' )
304+
"""

src/Config_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public function create( $_, $assoc_args ) {
340340
}
341341
}
342342
} catch ( Exception $exception ) {
343-
//Remove the default moustache wp-config.php template file.
343+
// Remove the default moustache wp-config.php template file.
344344
if ( file_exists( $assoc_args['config-file'] ) ) {
345345
unlink( $path );
346346
}

0 commit comments

Comments
 (0)