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
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": "^5.4.0"
},
"config": {
"process-timeout": 7200,
Expand Down
25 changes: 20 additions & 5 deletions features/plugin-list-wporg-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ Feature: Check the status of plugins on WordPress.org
@require-wp-5.2
Scenario: Install plugins and check the status on wp.org.
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And I run `wp plugin install https://downloads.wordpress.org/plugin/no-longer-in-directory.1.0.62.zip`
And a wp-content/plugins/never-wporg/never-wporg.php file:
"""
Expand Down Expand Up @@ -114,7 +117,10 @@ Feature: Check the status of plugins on WordPress.org
@require-wp-5.2
Scenario: The wp.org last updated date for an active plugin does not depend on a second, rate-limited request
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And that HTTP requests to https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Blocale%5D=en_US&request%5Bslug%5D=wordpress-importer will respond with:
"""
HTTP/1.1 200
Expand Down Expand Up @@ -146,7 +152,10 @@ Feature: Check the status of plugins on WordPress.org
@require-wp-5.2
Scenario: The wp.org last updated date falls back to the trac log when the plugin-info API omits it
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And that HTTP requests to https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Blocale%5D=en_US&request%5Bslug%5D=wordpress-importer will respond with:
"""
HTTP/1.1 200
Expand Down Expand Up @@ -180,7 +189,10 @@ Feature: Check the status of plugins on WordPress.org
@require-wp-5.2
Scenario: The wp.org last updated date falls back to the trac log when the plugin-info API date can't be parsed
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And that HTTP requests to https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Blocale%5D=en_US&request%5Bslug%5D=wordpress-importer will respond with:
"""
HTTP/1.1 200
Expand Down Expand Up @@ -217,7 +229,10 @@ Feature: Check the status of plugins on WordPress.org
@require-wp-5.2
Scenario: The wp.org last updated date stays empty when the trac log pubDate can't be parsed
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And that HTTP requests to https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Blocale%5D=en_US&request%5Bslug%5D=wordpress-importer will respond with:
"""
HTTP/1.1 200
Expand Down
10 changes: 8 additions & 2 deletions features/plugin-uninstall.feature
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ Feature: Uninstall a WordPress plugin
@require-wp-5.2
Scenario: Uninstalling a plugin should remove its language pack
Given a WP install
And I run `wp plugin install wordpress-importer`
And these installed plugins:
"""
wordpress-importer
"""
And I run `wp language core install fr_FR`
And I run `wp site switch-language fr_FR`

Expand All @@ -185,7 +188,10 @@ Feature: Uninstall a WordPress plugin
@require-wp-5.2
Scenario: Uninstalling a plugin should remove its update info
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.6`
And these installed plugins:
"""
wordpress-importer --version=0.6
"""
And I try `wp plugin status wordpress-importer`

And I run `wp transient get --network update_plugins`
Expand Down
45 changes: 36 additions & 9 deletions features/plugin-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ Feature: Update WordPress plugins
@require-wp-5.2
Scenario: Update a plugin to its latest patch release
Given a WP install
And I run `wp plugin install --force wordpress-importer --version=0.5`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""

When I run `wp plugin update wordpress-importer --patch`
Then STDOUT should contain:
Expand All @@ -99,7 +102,10 @@ Feature: Update WordPress plugins
@require-wp-5.8
Scenario: Update a plugin to its latest minor release
Given a WP install
And I run `wp plugin install --force akismet --version=2.5.4`
And these installed plugins:
"""
akismet --version=2.5.4 --force
"""

When I run `wp plugin update akismet --minor`
Then STDOUT should contain:
Expand Down Expand Up @@ -134,7 +140,10 @@ Feature: Update WordPress plugins
"""

# One plugin installed.
Given I run `wp plugin install wordpress-importer --version=0.5 --force`
Given these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""

When I try `wp plugin update`
Then the return code should be 1
Expand Down Expand Up @@ -170,7 +179,10 @@ Feature: Update WordPress plugins
"""

# Two plugins installed.
Given I run `wp plugin install akismet --version=2.5.4`
Given these installed plugins:
"""
akismet --version=2.5.4
"""

When I run `wp plugin update --all`
Then STDOUT should contain:
Expand Down Expand Up @@ -202,7 +214,10 @@ Feature: Update WordPress plugins
@require-wp-5.8 @skip-windows
Scenario: Plugin updates that error should not report a success
Given a WP install
And I run `wp plugin install --force akismet --version=4.0`
And these installed plugins:
"""
akismet --version=4.0 --force
"""

When I run `chmod -w wp-content/plugins/akismet`
And I try `wp plugin update akismet`
Expand Down Expand Up @@ -374,7 +389,10 @@ Feature: Update WordPress plugins
@require-wp-5.2 @skip-windows
Scenario: Failed plugin update keeps JSON output parseable
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And I run `chmod -w wp-content/plugins/wordpress-importer`

When I try `wp plugin update wordpress-importer --format=json`
Expand All @@ -390,7 +408,10 @@ Feature: Update WordPress plugins
@require-wp-5.2 @skip-windows
Scenario: Failed plugin update keeps CSV output parseable
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And I run `chmod -w wp-content/plugins/wordpress-importer`

When I try `wp plugin update wordpress-importer --format=csv`
Expand All @@ -406,7 +427,10 @@ Feature: Update WordPress plugins
@require-wp-5.2 @skip-windows
Scenario: Skip plugin update when plugin directory is a VCS checkout
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And I run `wp plugin path wordpress-importer --dir`
And save STDOUT as {PLUGIN_DIR}

Expand All @@ -426,7 +450,10 @@ Feature: Update WordPress plugins
@require-wp-5.2 @skip-windows
Scenario: Update plugin in VCS checkout when --include-vcs is set
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.5 --force`
And these installed plugins:
"""
wordpress-importer --version=0.5 --force
"""
And I run `wp plugin path wordpress-importer --dir`
And save STDOUT as {PLUGIN_DIR}

Expand Down
7 changes: 5 additions & 2 deletions features/plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,11 @@ Feature: Manage WordPress plugins
Given a WP multisite install
And I run `wp plugin delete --all`

When I run `wp plugin install debug-bar`
And I run `wp plugin install wordpress-importer --activate`
And these installed plugins:
"""
debug-bar
"""
When I run `wp plugin install wordpress-importer --activate`
Then STDOUT should contain:
"""
Plugin 'wordpress-importer' activated.
Expand Down
9 changes: 6 additions & 3 deletions features/theme-auto-update-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,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 these installed themes:
"""
twentysixteen
twentyseventeen
twentynineteen
"""

@require-wp-5.5
Scenario: Show an error if required params are missing
Expand Down
9 changes: 6 additions & 3 deletions features/theme-auto-updates-disable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,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 these installed themes:
"""
twentysixteen
twentyseventeen
twentynineteen
"""
And I try `wp theme auto-updates enable --all`

@require-wp-5.5
Expand Down
9 changes: 6 additions & 3 deletions features/theme-auto-updates-enable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,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 these installed themes:
"""
twentysixteen
twentyseventeen
twentynineteen
"""
And I try `wp theme auto-updates disable --all`

@require-wp-5.5
Expand Down
5 changes: 4 additions & 1 deletion features/theme-check-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ Feature: Check for theme updates
Scenario: Check for theme updates with no updates available
Given a WP install

When I run `wp theme install twentytwelve --force`
And these installed themes:
"""
twentytwelve --force
"""
# Ignore warnings if theme versions in trunk are newer than what's in the directory.
# This is only a temporary situation before an impending release.
And I try `wp theme update --all`
Expand Down
15 changes: 12 additions & 3 deletions features/theme-delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,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 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 Expand Up @@ -58,7 +64,10 @@ Feature: Delete WordPress themes

Scenario: Delete all installed themes when active theme has a parent
Given a WP install
And I run `wp theme install oceanly-green --activate`
And these installed and active themes:
"""
oceanly-green
"""

When I run `wp theme list --field=name`
Then STDOUT should contain:
Expand Down
37 changes: 29 additions & 8 deletions features/theme-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ Feature: Update WordPress themes
Scenario: Updating a theme with no version in the WordPress.org directory shouldn't delete the original theme
Given a WP install

When I run `wp theme install twentytwelve --force`
And I run `wp scaffold child-theme wpclitesttheme --parent_theme=twentytwelve`
And these installed themes:
"""
twentytwelve --force
"""
When I run `wp scaffold child-theme wpclitesttheme --parent_theme=twentytwelve`
Then the wp-content/themes/wpclitesttheme directory should exist

When I try `wp theme update wpclitesttheme --version=100.0.0`
Expand Down Expand Up @@ -50,7 +53,10 @@ Feature: Update WordPress themes
"""

# One theme installed.
Given I run `wp theme install storefront --version=1.0.0`
Given these installed themes:
"""
storefront --version=1.0.0
"""

When I try `wp theme update`
Then the return code should be 1
Expand Down Expand Up @@ -86,7 +92,10 @@ Feature: Update WordPress themes
"""

# Two themes installed.
Given I run `wp theme install --force twentytwelve --version=1.0`
Given these installed themes:
"""
twentytwelve --version=1.0 --force
"""

When I run `wp theme update --all`
Then STDOUT should contain:
Expand Down Expand Up @@ -125,7 +134,10 @@ Feature: Update WordPress themes

Scenario: Update a theme to its latest minor release
Given a WP install
And I run `wp theme install --force twentytwelve --version=3.0`
And these installed themes:
"""
twentytwelve --version=3.0 --force
"""

When I run `wp theme update twentytwelve --minor`
Then STDOUT should contain:
Expand All @@ -141,7 +153,10 @@ Feature: Update WordPress themes

Scenario: Update a theme to its latest patch release
Given a WP install
And I run `wp theme install --force twentytwelve --version=1.1`
And these installed themes:
"""
twentytwelve --version=1.1 --force
"""

When I run `wp theme update twentytwelve --patch`
Then STDOUT should contain:
Expand Down Expand Up @@ -260,7 +275,10 @@ Feature: Update WordPress themes

Scenario: Skip theme update when theme directory is a VCS checkout
Given a WP install
And I run `wp theme install twentytwelve --version=3.0 --force`
And these installed themes:
"""
twentytwelve --version=3.0 --force
"""
And I run `wp theme path twentytwelve --dir`
And save STDOUT as {THEME_DIR}

Expand All @@ -278,7 +296,10 @@ Feature: Update WordPress themes

Scenario: Update theme in VCS checkout when --include-vcs is set
Given a WP install
And I run `wp theme install twentytwelve --version=3.0 --force`
And these installed themes:
"""
twentytwelve --version=3.0 --force
"""
And I run `wp theme path twentytwelve --dir`
And save STDOUT as {THEME_DIR}

Expand Down
Loading
Loading