Skip to content

Commit c770538

Browse files
swissspidyclaude
andauthored
Make invalid --porcelain test compatible with core option validation (#261)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent ee69c48 commit c770538

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎features/media-import.feature‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ Feature: Manage WordPress attachments
284284
When I try `wp media import 'http://wp-cli.github.io/behat-data/codeispoetry.png' --porcelain=invalid`
285285
Then STDERR should be:
286286
"""
287-
Error: Invalid value for <porcelain>: invalid. Expected flag or 'url'.
287+
Error: Parameter errors:
288+
Invalid value specified for 'porcelain' (Output a single field for each imported image. Defaults to attachment ID when used as flag.)
288289
"""
289290

290291
Scenario: Import media from STDIN

‎src/Media_Command.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,6 @@ public function import( $args, $assoc_args = array() ) {
501501
}
502502

503503
$porcelain = Utils\get_flag_value( $assoc_args, 'porcelain' );
504-
if ( is_string( $porcelain ) && ! in_array( $porcelain, array( 'url' ), true ) ) {
505-
WP_CLI::error( sprintf( 'Invalid value for <porcelain>: %s. Expected flag or \'url\'.', $porcelain ) );
506-
}
507504

508505
if ( isset( $assoc_args['post_id'] ) ) {
509506
if ( ! get_post( $assoc_args['post_id'] ) ) {

0 commit comments

Comments
 (0)