Skip to content

Commit

Permalink
Merge pull request #144 from borkweb/fix/140-config-create-debug-defined
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera authored Sep 11, 2022
2 parents 2325d98 + 7890063 commit b665cb2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 14 deletions.
24 changes: 24 additions & 0 deletions features/config-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,30 @@ Feature: Create a wp-config file
Error: The site you have requested is not installed
"""
When I run `rm wp-custom-config.php`
Then the wp-custom-config.php file should not exist
Given a wp-config-extra.php file:
"""
define( 'WP_DEBUG', true );
"""
When I run `wp core config {CORE_CONFIG_SETTINGS} --config-file='wp-custom-config.php' --extra-php < wp-config-extra.php`
Then the wp-custom-config.php file should contain:
"""
define( 'WP_DEBUG', true );
"""
And the wp-custom-config.php file should contain:
"""
define( 'WP_DEBUG', false );
"""
When I try `wp version`
Then STDERR should not contain:
"""
Constant WP_DEBUG already defined
"""
@require-wp-4.0
Scenario: No wp-config.php and WPLANG
Given an empty directory
Expand Down
30 changes: 16 additions & 14 deletions templates/wp-config.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@ define( 'WP_CACHE_KEY_SALT', '{{wp-cache-key-salt}}' );
*/
$table_prefix = '{{dbprefix}}';

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://wordpress.org/support/article/debugging-in-wordpress/
*/
define( 'WP_DEBUG', false );

{{#add-wplang}}
/**
* WordPress localized language, defaults to English.
Expand All @@ -102,6 +88,22 @@ define( 'WPLANG', '{{locale}}' );

{{extra-php}}

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://wordpress.org/support/article/debugging-in-wordpress/
*/
if ( ! defined( 'WP_DEBUG' ) ) {
define( 'WP_DEBUG', false );
}

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
Expand Down

0 comments on commit b665cb2

Please sign in to comment.