Skip to content
Merged
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
19 changes: 19 additions & 0 deletions features/db-import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,25 @@ Feature: Import a WordPress database
Success: Imported from 'debug.sql'.
"""

# Regression test for https://github.com/wp-cli/db-command/issues/218
# The `--ssl` flag used to be silently dropped by `get_mysql_args()` because it
# was missing from the list of allowed MySQL client options, so `wp db import
# --ssl` connected without SSL. Assert the flag is now forwarded to the MySQL
# command (visible in the debug output before the connection is attempted).
# SQLite does not use the MySQL client, hence the tag.
@require-mysql-or-mariadb
Scenario: Import forwards the --ssl flag to the MySQL client
Given a WP install

When I run `wp db export wp_cli_test.sql`
Then the wp_cli_test.sql file should exist

When I try `wp db import wp_cli_test.sql --ssl --debug`
Then STDERR should contain:
"""
--ssl
"""

# For SQLite this would fail at the `wp db create` step
# because of the missing plugin/drop-in.
@require-mysql-or-mariadb
Expand Down
2 changes: 2 additions & 0 deletions src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -2231,7 +2231,9 @@ private static function get_mysql_args( $assoc_args ) {
'skip-named-commands',
'skip-pager',
'skip-reconnect',
'skip-ssl',
'socket',
'ssl',
'ssl-ca',
'ssl-capath',
'ssl-cert',
Expand Down
Loading