Skip to content
Open
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
35 changes: 35 additions & 0 deletions features/theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,41 @@ Feature: Manage WordPress themes
| moina-blog | active |
| moina | parent |

@require-wp-5.7
Scenario: List broken themes (child theme without parent)
Given a WP install
And I run `wp theme install moina`
And I run `wp theme install moina-blog`

When I run `wp theme list --fields=name,status`
Then STDOUT should be a table containing rows:
| name | status |
| moina-blog | inactive |
| moina | inactive |

When I run `wp theme delete moina`
Then STDOUT should contain:
"""
Deleted 'moina' theme.
"""

When I run `wp theme list --fields=name,status`
Then STDOUT should be a table containing rows:
| name | status |
| moina-blog | inactive |

When I try `wp theme activate moina-blog`
Then STDERR should contain:
"""
Error: The parent theme is missing. Please install the "moina" parent theme.
"""

When I try `wp theme install moina-blog`
Then STDERR should contain:
"""
Warning: moina-blog: Theme already installed.
"""

Scenario: When updating a theme --format should be the same when using --dry-run
Given a WP install
And I run `wp theme delete --all --force`
Expand Down
2 changes: 1 addition & 1 deletion src/WP_CLI/ParseThemeNameInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private function get_all_themes() {
$auto_updates = [];
}

foreach ( wp_get_themes() as $key => $theme ) {
foreach ( wp_get_themes( array( 'errors' => null ) ) as $key => $theme ) {
$stylesheet = $theme->get_stylesheet();
$update_info = ( isset( $all_update_info->response[ $stylesheet ] ) && null !== $all_update_info->response[ $theme->get_stylesheet() ] ) ? (array) $all_update_info->response[ $theme->get_stylesheet() ] : null;

Expand Down
Loading