Skip to content
Draft
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"wp-cli/entity-command": "^1.3 || ^2 || ^3",
"wp-cli/language-command": "^2.0 || ^3",
"wp-cli/scaffold-command": "^1.2 || ^2 || ^3",
"wp-cli/wp-cli-tests": "^5"
"wp-cli/wp-cli-tests": "dev-only-these-themes as 5.3.99"
},
"config": {
"process-timeout": 7200,
Expand Down
10 changes: 6 additions & 4 deletions features/theme-auto-update-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ Feature: Show the status of auto-updates for WordPress themes

Background:
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentysixteen`
And I run `wp theme install twentyseventeen`
And I run `wp theme install twentynineteen`
And only these installed themes:
"""
twentysixteen
twentyseventeen
twentynineteen
"""

@require-wp-5.5
Scenario: Show an error if required params are missing
Expand Down
10 changes: 6 additions & 4 deletions features/theme-auto-updates-disable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ Feature: Disable auto-updates for WordPress themes

Background:
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentysixteen`
And I run `wp theme install twentyseventeen`
And I run `wp theme install twentynineteen`
And only these installed themes:
"""
twentysixteen
twentyseventeen
twentynineteen
"""
And I try `wp theme auto-updates enable --all`

@require-wp-5.5
Expand Down
10 changes: 6 additions & 4 deletions features/theme-auto-updates-enable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ Feature: Enable auto-updates for WordPress themes

Background:
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentysixteen`
And I run `wp theme install twentyseventeen`
And I run `wp theme install twentynineteen`
And only these installed themes:
"""
twentysixteen
twentyseventeen
twentynineteen
"""
And I try `wp theme auto-updates disable --all`

@require-wp-5.5
Expand Down
11 changes: 8 additions & 3 deletions features/theme-delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ Feature: Delete WordPress themes

Background:
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentytwelve`
And I run `wp theme install twentyeleven --activate`
And only these installed themes:
"""
twentytwelve
"""
And these installed and active themes:
"""
twentyeleven
"""

Scenario: Delete an installed theme
When I run `wp theme delete twentytwelve`
Expand Down
2 changes: 1 addition & 1 deletion features/theme-install.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Install WordPress themes

Background:
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

Scenario: Return code is 1 when one or more theme installations fail
When I try `wp theme install twentytwelve twentytwelve-not-a-theme`
Expand Down
4 changes: 2 additions & 2 deletions features/theme-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: Update WordPress themes

Scenario: Install a theme, then update to a specific version of that theme
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `wp theme install twentytwelve --version=3.0`
Then STDOUT should not be empty
Expand Down Expand Up @@ -239,7 +239,7 @@ Feature: Update WordPress themes
@require-wp-4.5
Scenario: Updating all themes should show the name of each theme as it is updated
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `wp theme install storefront --version=1.0.0`
Then STDOUT should not be empty
Expand Down
60 changes: 39 additions & 21 deletions features/theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ Feature: Manage WordPress themes

Scenario: Installing and deleting theme
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentyeleven --activate`
And only these installed and active themes:
"""
twentyeleven
"""

When I run `wp theme install twentytwelve`
Then STDOUT should not be empty
Expand Down Expand Up @@ -85,8 +87,10 @@ Feature: Manage WordPress themes

Scenario: Install a theme, activate, then force install an older version of the theme
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentyeleven --activate`
And only these installed and active themes:
"""
twentyeleven
"""

When I run `wp theme install twentytwelve --version=1.4`
Then STDOUT should not be empty
Expand Down Expand Up @@ -142,8 +146,10 @@ Feature: Manage WordPress themes

Scenario: Exclude theme from bulk updates.
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentyeleven --activate`
And only these installed and active themes:
"""
twentyeleven
"""

When I run `wp theme install twentytwelve --version=1.4 --force`
Then STDOUT should contain:
Expand Down Expand Up @@ -185,7 +191,7 @@ Feature: Manage WordPress themes

Scenario: Get the path of an installed theme
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `wp theme install twentytwelve`
Then STDOUT should not be empty
Expand All @@ -198,7 +204,7 @@ Feature: Manage WordPress themes

Scenario: Activate an already active theme
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `wp theme install twentytwelve`
Then STDOUT should not be empty
Expand Down Expand Up @@ -276,7 +282,7 @@ Feature: Manage WordPress themes

Scenario: Install a theme when the theme directory doesn't yet exist
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `rm -rf wp-content/themes`
And I run `wp eval "if ( is_dir('wp-content/themes') ) echo 'fail';"`
Expand Down Expand Up @@ -487,7 +493,7 @@ Feature: Manage WordPress themes

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`
And an empty wp-content/themes directory

When I run `wp theme install --force twentytwelve --version=1.0`
Then STDOUT should not be empty
Expand Down Expand Up @@ -527,7 +533,7 @@ Feature: Manage WordPress themes

Scenario: Check json and csv formats when updating a theme
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `wp theme install --force twentytwelve --version=1.0`
Then STDOUT should not be empty
Expand Down Expand Up @@ -581,7 +587,7 @@ Feature: Manage WordPress themes

Scenario: Get status field in theme detail
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `wp theme install twentytwelve`
Then STDOUT should not be empty
Expand All @@ -608,7 +614,7 @@ Feature: Manage WordPress themes

Scenario: Theme activation fails when slug does not match exactly
Given a WP install
And I run `wp theme delete --all --force`
And an empty wp-content/themes directory

When I run `wp theme install twentytwelve`
Then the return code should be 0
Expand Down Expand Up @@ -667,9 +673,14 @@ Feature: Manage WordPress themes
@require-wp-5.7
Scenario: Parent theme is active when its child is active
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentytwelve`
And I run `wp theme install oceanly-green --activate`
And only these installed themes:
"""
twentytwelve
"""
And these installed and active themes:
"""
oceanly-green
"""

When I run `wp theme is-active oceanly-green`
Then the return code should be 0
Expand All @@ -682,8 +693,10 @@ Feature: Manage WordPress themes

Scenario: Excluding a missing theme should not throw an error
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentytwelve --version=1.5 --activate`
And only these installed and active themes:
"""
twentytwelve --version=1.5
"""
And I run `wp theme update --all --exclude=missing-theme`
Then STDERR should be empty
And STDOUT should contain:
Expand Down Expand Up @@ -882,9 +895,14 @@ Feature: Manage WordPress themes

Scenario: Filter theme list by multiple names
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentyeleven --activate`
And I run `wp theme install twentytwelve`
And only these installed themes:
"""
twentytwelve
"""
And these installed and active themes:
"""
twentyeleven
"""

When I run `wp theme list --name=twentytwelve,twentyeleven --fields=name,status`
Then STDOUT should be a table containing rows:
Expand Down
Loading