File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,25 @@ Feature: Import a WordPress database
106106 Success: Imported from 'debug.sql'.
107107 """
108108
109+ # Regression test for https://github.com/wp-cli/db-command/issues/218
110+ # The `--ssl` flag used to be silently dropped by `get_mysql_args()` because it
111+ # was missing from the list of allowed MySQL client options, so `wp db import
112+ # --ssl` connected without SSL. Assert the flag is now forwarded to the MySQL
113+ # command (visible in the debug output before the connection is attempted).
114+ # SQLite does not use the MySQL client, hence the tag.
115+ @require-mysql-or-mariadb
116+ Scenario : Import forwards the --ssl flag to the MySQL client
117+ Given a WP install
118+
119+ When I run `wp db export wp_cli_test.sql`
120+ Then the wp_cli_test.sql file should exist
121+
122+ When I try `wp db import wp_cli_test.sql --ssl --debug`
123+ Then STDERR should contain:
124+ """
125+ --ssl
126+ """
127+
109128 # For SQLite this would fail at the `wp db create` step
110129 # because of the missing plugin/drop-in.
111130 @require-mysql-or-mariadb
Original file line number Diff line number Diff line change @@ -2231,7 +2231,9 @@ private static function get_mysql_args( $assoc_args ) {
22312231 'skip-named-commands ' ,
22322232 'skip-pager ' ,
22332233 'skip-reconnect ' ,
2234+ 'skip-ssl ' ,
22342235 'socket ' ,
2236+ 'ssl ' ,
22352237 'ssl-ca ' ,
22362238 'ssl-capath ' ,
22372239 'ssl-cert ' ,
You can’t perform that action at this time.
0 commit comments