Skip to content

Commit 617157d

Browse files
Copilotswissspidy
andauthored
Fix test: Use wp config create pattern to preserve DB connection
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 86a2c3b commit 617157d

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

‎features/db-check.feature‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,21 @@ Feature: Check the database
164164

165165
@require-mysql-or-mariadb
166166
Scenario: Empty DB credentials should not cause empty parameter errors
167-
Given a WP install
168-
And a wp-config.php file:
167+
Given an empty directory
168+
And WP files
169+
170+
When I run `wp config create {CORE_CONFIG_SETTINGS} --dbcharset="" --skip-check`
171+
Then STDOUT should not be empty
172+
173+
When I run `cat wp-config.php`
174+
Then STDOUT should contain:
169175
"""
170-
<?php
171-
define( 'DB_NAME', 'wp_cli_test' );
172-
define( 'DB_USER', 'wp_cli_test' );
173-
define( 'DB_PASSWORD', 'password1' );
174-
define( 'DB_HOST', 'localhost' );
175176
define( 'DB_CHARSET', '' );
176-
define( 'DB_COLLATE', '' );
177-
$table_prefix = 'wp_';
178-
require_once ABSPATH . 'wp-settings.php';
179177
"""
180178

179+
When I run `wp db create`
180+
Then STDOUT should not be empty
181+
181182
When I run `wp db check --debug`
182183
Then the return code should be 0
183184
And STDOUT should contain:

0 commit comments

Comments
 (0)