Skip to content
Prev Previous commit
Next Next commit
Feature: added functional tests for minor and patch to theme update
  • Loading branch information
up1512001 committed Jan 22, 2024
commit d03027f27b286babd2b1dfa89f2574d080f6db3b
42 changes: 42 additions & 0 deletions features/theme-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,45 @@ Feature: Update WordPress themes
"""
Error: Can't find the requested theme's version 1.4.2 in the WordPress.org theme repository (HTTP code 404).
"""

Scenario: Error when both --minor and --patch are provided
Given a WP install

When I try `wp theme update --patch --minor --all`
Then STDERR should be:
"""
Error: --minor and --patch cannot be used together.
"""
And the return code should be 1

Scenario: Update a theme to its latest minor release
Given a WP install
And I run `wp theme install --force twentytwelve --version=2.5.4`

When I run `wp theme update twentytwelve --minor`
Then STDOUT should contain:
"""
Success: Updated 1 of 1 themes.
"""

When I run `wp theme get twentytwelve --field=version`
Then STDOUT should be:
"""
2.6.1
"""

Scenario: Update a theme to its latest patch release
Given a WP install
And I run `wp theme install --force twentytwelve --version=0.5`

When I run `wp theme update twentytwelve --patch`
Then STDOUT should contain:
"""
Success: Updated 1 of 1 themes.
"""

When I run `wp theme get twentytwelve --field=version`
Then STDOUT should be:
"""
0.5.2
"""