diff --git a/features/config-create.feature b/features/config-create.feature index ffca1bdf..18aeada5 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -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 diff --git a/templates/wp-config.mustache b/templates/wp-config.mustache index 75b3fdd5..b6ffd668 100644 --- a/templates/wp-config.mustache +++ b/templates/wp-config.mustache @@ -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. @@ -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. */