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
8 changes: 6 additions & 2 deletions features/core-check-update-db.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Feature: Check if WordPress database update is needed
"""
twentytwenty
"""
And I run `wp core download --version=5.4 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=5.4 --force`
And the return code should be 0
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`

When I try `wp core check-update-db`
Expand Down Expand Up @@ -66,7 +68,9 @@ Feature: Check if WordPress database update is needed
"""
twentytwenty
"""
And I run `wp core download --version=6.6 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=6.6 --force`
And the return code should be 0
And I run `wp option update db_version 57155 --require=disable_sidebar_check.php`
And I run `wp site option update wpmu_upgrade_site 57155`
And I run `wp site create --slug=foo`
Expand Down
6 changes: 4 additions & 2 deletions features/core-check-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Feature: Check for more recent versions
twentytwenty
"""

When I run `wp core download --version=5.8 --force`
Then STDOUT should not be empty
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=5.8 --force`
Then the return code should be 0
And STDOUT should not be empty

When I run `wp core check-update --format=csv`
Then STDOUT should match #{WP_VERSION-latest},major,https://downloads.(w|wordpress).org/release/wordpress-{WP_VERSION-latest}.zip#
Expand Down
20 changes: 15 additions & 5 deletions features/core-update-db.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Feature: Update core's database
"""
twentytwenty
"""
And I run `wp core download --version=5.4 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=5.4 --force`
And the return code should be 0
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`

When I run `wp core update-db`
Expand Down Expand Up @@ -51,7 +53,9 @@ Feature: Update core's database
"""
twentytwenty
"""
And I run `wp core download --version=5.4 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=5.4 --force`
And the return code should be 0
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`

When I run `wp core update-db --dry-run`
Expand Down Expand Up @@ -85,7 +89,9 @@ Feature: Update core's database
"""
twentytwenty
"""
And I run `wp core download --version=5.4 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=5.4 --force`
And the return code should be 0
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
And I run `wp site option update wpmu_upgrade_site 45805`
And I run `wp site create --slug=foo`
Expand Down Expand Up @@ -133,7 +139,9 @@ Feature: Update core's database
"""
twentytwenty
"""
And I run `wp core download --version=5.4 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=5.4 --force`
And the return code should be 0
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
And I run `wp site option update wpmu_upgrade_site 45805`
And I run `wp site create --slug=foo`
Expand Down Expand Up @@ -193,7 +201,9 @@ Feature: Update core's database
"""
twentytwenty
"""
And I run `wp core download --version=5.4 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=5.4 --force`
And the return code should be 0
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
And I run `wp site option update wpmu_upgrade_site 45805`
# Create 2 additional sites in network 1 (main site already exists; 3 total in network 1)
Expand Down
87 changes: 59 additions & 28 deletions features/core-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Feature: Update WordPress core
twentytwenty
"""

When I run `wp core download --version=6.2 --force`
Then STDOUT should not be empty
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.2 --force`
Then the return code should be 0
And STDOUT should not be empty

When I try `wp eval 'echo $GLOBALS["wp_version"];'`
Then STDOUT should be:
Expand Down Expand Up @@ -43,8 +45,10 @@ Feature: Update WordPress core
twentytwenty
"""

When I run `wp core download --version=6.6 --force`
Then STDOUT should not be empty
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.6 --force`
Then the return code should be 0
And STDOUT should not be empty

When I run `wp eval 'echo $GLOBALS["wp_version"];'`
Then STDOUT should be:
Expand All @@ -67,8 +71,10 @@ Feature: Update WordPress core
twentytwenty
"""

When I run `wp core download --version=6.6 --force`
Then STDOUT should not be empty
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.6 --force`
Then the return code should be 0
And STDOUT should not be empty

When I run `wp eval 'echo $GLOBALS["wp_version"];'`
Then STDOUT should be:
Expand All @@ -92,8 +98,10 @@ Feature: Update WordPress core
twentytwenty
"""

When I run `wp core download --version=6.6 --force`
Then STDOUT should not be empty
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.6 --force`
Then the return code should be 0
And STDOUT should not be empty

When I run `wp eval 'echo $GLOBALS["wp_version"];'`
Then STDOUT should be:
Expand All @@ -116,8 +124,10 @@ Feature: Update WordPress core
twentytwenty
"""

When I run `wp core download --version=6.2.5 --force`
Then STDOUT should contain:
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.2.5 --force`
Then the return code should be 0
And STDOUT should contain:
"""
Success: WordPress downloaded.
"""
Expand Down Expand Up @@ -156,8 +166,10 @@ Feature: Update WordPress core
"""
And an empty cache

When I run `wp core update --version=6.2.5 --force`
Then STDOUT should not contain:
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core update --version=6.2.5 --force`
Then the return code should be 0
And STDOUT should not contain:
"""
Using cached file
"""
Expand All @@ -182,7 +194,9 @@ Feature: Update WordPress core
@require-php-7.4
Scenario: Don't run update when up-to-date
Given a WP install
And I run `wp core update`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core update`
And the return code should be 0

When I run `wp core update`
Then STDOUT should contain:
Expand Down Expand Up @@ -242,8 +256,11 @@ Feature: Update WordPress core
);
"""

When I run `wp core download --version=6.5.2 --force`
And I run `wp core update`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.5.2 --force`
Then the return code should be 0

When I run `wp core update`
Then STDOUT should contain:
"""
Success: WordPress updated successfully.
Expand Down Expand Up @@ -285,8 +302,10 @@ Feature: Update WordPress core
twentytwenty
"""

When I run `wp core update --version=4.4 --force`
Then the wp-includes/rest-api.php file should exist
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core update --version=4.4 --force`
Then the return code should be 0
And the wp-includes/rest-api.php file should exist
And the wp-includes/class-wp-comment.php file should exist
And STDOUT should not contain:
"""
Expand Down Expand Up @@ -325,8 +344,10 @@ Feature: Update WordPress core
twentytwenty
"""

When I run `wp core update --version=5.8 --force`
Then the wp-includes/Requests/Transport/cURL.php file should exist
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core update --version=5.8 --force`
Then the return code should be 0
And the wp-includes/Requests/Transport/cURL.php file should exist
And the wp-includes/Requests/Exception/Transport/cURL.php file should exist
And the wp-includes/Requests/Exception/HTTP/502.php file should exist
And the wp-includes/Requests/IRI.php file should exist
Expand Down Expand Up @@ -366,8 +387,10 @@ Feature: Update WordPress core
Scenario Outline: Use `--version=(nightly|trunk)` to update to the latest nightly version
Given a WP install

When I run `wp core update --version=<version>`
Then STDOUT should contain:
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core update --version=<version>`
Then the return code should be 0
And STDOUT should contain:
"""
Updating to version nightly (en_US)...
Downloading update from https://wordpress.org/nightly-builds/wordpress-latest.zip...
Expand Down Expand Up @@ -411,8 +434,10 @@ Feature: Update WordPress core
Scenario: Allow installing major version with trailing zero
Given a WP install

When I run `wp core update --version=6.2.0 --force`
Then STDOUT should contain:
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core update --version=6.2.0 --force`
Then the return code should be 0
And STDOUT should contain:
"""
Success:
"""
Expand Down Expand Up @@ -456,7 +481,9 @@ Feature: Update WordPress core
Scenario: Old files from $_old_files are cleaned up when upgrading
Given a WP install

When I run `wp core download --version=6.8 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.8 --force`
Then the return code should be 0

# Create files that should be removed according to 6.9 old_files list
Given a wp-includes/blocks/post-author/editor.css file:
Expand Down Expand Up @@ -498,8 +525,10 @@ Feature: Update WordPress core
Scenario: Old files cleanup works when checksums unavailable
Given a WP install

When I run `wp core download --version=6.8 --force`
Then STDOUT should contain:
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core download --version=6.8 --force`
Then the return code should be 0
And STDOUT should contain:
"""
Success: WordPress downloaded.
"""
Expand Down Expand Up @@ -628,8 +657,10 @@ Feature: Update WordPress core
"""
And the return code should be 0

When I run `wp core update --version=6.0 --force`
Then STDOUT should contain:
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
When I try `wp core update --version=6.0 --force`
Then the return code should be 0
And STDOUT should contain:
"""
Updating to version 6.0
"""
Expand Down
4 changes: 3 additions & 1 deletion features/core-version.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ Feature: Find version for WordPress install

Scenario: Verify core version
Given a WP install
And I run `wp core download --version=4.4.2 --force`
# May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build.
And I try `wp core download --version=4.4.2 --force`
And the return code should be 0

When I run `wp core version`
Then STDOUT should be:
Expand Down