diff --git a/features/user-import-csv.feature b/features/user-import-csv.feature index a0098e6f3..802ffb92e 100644 --- a/features/user-import-csv.feature +++ b/features/user-import-csv.feature @@ -140,7 +140,6 @@ Feature: Import users from CSV | Bob Jones | contributor | | Bill Jones | administrator,author | - @broken Scenario: Importing users from STDIN Given a WP install And a users.csv file: diff --git a/src/User_Command.php b/src/User_Command.php index 461d6bd4b..59d6f3d34 100644 --- a/src/User_Command.php +++ b/src/User_Command.php @@ -1150,6 +1150,10 @@ public function import_csv( $args, $assoc_args ) { $csv_data[] = $data; } + + if ( empty( $indexes ) && empty( $csv_data ) ) { + WP_CLI::error( 'Unable to read content from STDIN.' ); + } } else { $csv_data = new CsvIterator( $filename ); }