Skip to content
Closed
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
11 changes: 11 additions & 0 deletions features/config-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,14 @@ Feature: Create a wp-config file
"""
define( 'DB_USER', 'wp_cli_test_ssl' )
"""

Scenario: Create config without WordPress bootstrap
Given an empty directory

When I run `wp config create --skip-check --dbname=testdb --dbuser=testuser --dbpass=testpass`
Then the return code should be 0
And STDOUT should contain:
"""
Success: Generated 'wp-config.php' file.
"""
And the wp-config.php file should exist
2 changes: 2 additions & 0 deletions src/Config_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ private static function get_initial_locale() {
* # Using --prompt=dbpass will prompt for the 'dbpass' argument
* $ wp config create --dbname=testing --dbuser=wp --prompt=dbpass < password.txt
* Success: Generated 'wp-config.php' file.
*
* @when before_wp_load
*/
public function create( $_, $assoc_args ) {
if ( ! Utils\get_flag_value( $assoc_args, 'force' ) ) {
Expand Down
Loading