Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix output message for STDIN input #151

Merged
merged 2 commits into from Nov 3, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions features/db-import.feature
Expand Up @@ -12,6 +12,15 @@ Feature: Import a WordPress database
Success: Imported from 'wp_cli_test.sql'.
"""

Scenario: Import from STDIN
Given a WP install

When I run `wp db import -`
Then STDOUT should be:
"""
Success: Imported from 'STDIN'.
"""

Scenario: Import from database name path by default and skip speed optimization
Given a WP install

Expand Down
2 changes: 2 additions & 0 deletions src/DB_Command.php
Expand Up @@ -580,6 +580,8 @@ public function import( $args, $assoc_args ) {
: 'SET autocommit = 0; SET unique_checks = 0; SET foreign_key_checks = 0; SOURCE %s; COMMIT;';

$mysql_args['execute'] = sprintf( $query, $result_file );
} else {
$result_file = 'STDIN';
}
// Check if any mysql option pass.
$mysql_args = array_merge( $mysql_args, self::get_mysql_args( $assoc_args ) );
Expand Down