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: 16 additions & 3 deletions features/theme-install.feature
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ Feature: Install WordPress themes
Scenario: Installation of multiple themes with activate
When I try `wp theme install twentytwelve twentyeleven --activate`
Then STDERR should contain:
"""
Warning: Only a single theme can be active.
"""
"""
Warning: Only this single theme will be activated: twentyeleven
"""

When I run `wp theme list --field=name`
Then STDOUT should contain:
"""
twentyeleven
twentytwelve
"""

When I run `wp theme list --field=name --status=active`
Then STDOUT should contain:
"""
twentyeleven
"""
3 changes: 2 additions & 1 deletion src/Theme_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ protected function filter_item_list( $items, $args ) {
*/
public function install( $args, $assoc_args ) {
if ( count( $args ) > 1 && Utils\get_flag_value( $assoc_args, 'activate', false ) ) {
WP_CLI::warning( 'Only a single theme can be active.' );
WP_CLI::warning( sprintf( 'Only this single theme will be activated: %s', end( $args ) ) );
reset( $args );
}

$theme_root = get_theme_root();
Expand Down