From aed5b181fc03bcd33bfabbb976c25320832fc9c8 Mon Sep 17 00:00:00 2001 From: wojsmol Date: Thu, 2 Dec 2021 17:39:53 +0100 Subject: [PATCH 01/15] Update download_package function signature --- src/WP_CLI/Core/CoreUpgrader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WP_CLI/Core/CoreUpgrader.php b/src/WP_CLI/Core/CoreUpgrader.php index 18ca4a06..f331213e 100644 --- a/src/WP_CLI/Core/CoreUpgrader.php +++ b/src/WP_CLI/Core/CoreUpgrader.php @@ -41,11 +41,11 @@ public function __construct( $skin = null, $insecure = false ) { * * @param string $package The URI of the package. If this is the full path to an * existing local file, it will be returned untouched. - * @param bool $check_signatures Whether to validate file signatures. Default true. + * @param bool $check_signatures Whether to validate file signatures. Default false. * @param array $hook_extra Extra arguments to pass to the filter hooks. Default empty array. * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object. */ - public function download_package( $package, $check_signatures = true, $hook_extra = [] ) { + public function download_package( $package, $check_signatures = false, $hook_extra = [] ) { /** * Filter whether to return the package. From c50412ce53ebfcbf8fedaf5a08b80271ba9dd6c4 Mon Sep 17 00:00:00 2001 From: wojsmol Date: Thu, 2 Dec 2021 18:47:58 +0100 Subject: [PATCH 02/15] Update wp-cli/wp-cli-tests to 3.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f107aa70..2826a807 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "wp-cli/db-command": "^1.3 || ^2", "wp-cli/entity-command": "^1.3 || ^2", "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^3.0.11" + "wp-cli/wp-cli-tests": "^3.1" }, "config": { "process-timeout": 7200, From c4495218002167bd8f4e22fcedc92d3924e651b3 Mon Sep 17 00:00:00 2001 From: wojsmol Date: Fri, 3 Dec 2021 15:17:48 +0100 Subject: [PATCH 03/15] Switch theme before downgrade --- features/core-update.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/core-update.feature b/features/core-update.feature index 35b4d7f2..d2c942a6 100644 --- a/features/core-update.feature +++ b/features/core-update.feature @@ -213,6 +213,7 @@ Feature: Update WordPress core @less-than-php-7.3 Scenario: Make sure files are cleaned up Given a WP install + And I run `wp theme activate twentytwenty` When I run `wp core update --version=4.4 --force` Then the wp-includes/rest-api.php file should exist Then the wp-includes/class-wp-comment.php file should exist From 0445289b10f9f2d4bf2b4e269f91913e7b39e5d2 Mon Sep 17 00:00:00 2001 From: wojsmol Date: Fri, 3 Dec 2021 15:30:48 +0100 Subject: [PATCH 04/15] more fixes in tests --- features/core-update-db.feature | 2 ++ features/core-update.feature | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/features/core-update-db.feature b/features/core-update-db.feature index e938e700..4d34dd25 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -37,6 +37,7 @@ Feature: Update core's database Scenario: Update db across network Given a WP multisite install + And I run `wp theme activate twentytwenty` And I run `wp core download --version=5.4 --force` And I run `wp option update db_version 45805` And I run `wp site option update wpmu_upgrade_site 45805` @@ -69,6 +70,7 @@ Feature: Update core's database Scenario: Update db across network, dry run Given a WP multisite install + And I run `wp theme activate twentytwenty` And I run `wp core download --version=5.4 --force` And I run `wp option update db_version 45805` And I run `wp site option update wpmu_upgrade_site 45805` diff --git a/features/core-update.feature b/features/core-update.feature index d2c942a6..2f8ac298 100644 --- a/features/core-update.feature +++ b/features/core-update.feature @@ -2,6 +2,7 @@ Feature: Update WordPress core Scenario: Update from a ZIP file Given a WP install + And I run `wp theme activate twentytwenty` When I run `wp core download --version=3.9 --force` Then STDOUT should not be empty @@ -97,6 +98,7 @@ Feature: Update WordPress core Scenario: Core update from cache Given a WP install + And I run `wp theme activate twentytwenty` And an empty cache When I run `wp core update --version=3.9.1 --force` @@ -145,6 +147,7 @@ Feature: Update WordPress core Scenario: Ensure cached partial upgrades aren't used in full upgrade Given a WP install + And I run `wp theme activate twentytwenty` And an empty cache And a wp-content/mu-plugins/upgrade-override.php file: """ @@ -248,6 +251,7 @@ Feature: Update WordPress core @less-than-php-7.3 Scenario: Minor update on an unlocalized WordPress release Given a WP install + And I run `wp theme activate twentytwenty` And an empty cache # If current WP_VERSION is nightly, trunk or old then from checksums might not exist, so STDERR may or may not be empty. From 3ec42f93ae81b4279387af248b7b4bcc098d84a0 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Wed, 15 Dec 2021 10:43:14 -0500 Subject: [PATCH 05/15] Bump framework constraint --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2826a807..5577cb35 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "composer/semver": "^1.4 || ^2 || ^3", - "wp-cli/wp-cli": "^2.5" + "wp-cli/wp-cli": "^2.5.1" }, "require-dev": { "wp-cli/checksum-command": "^1 || ^2", From cbcc31ecd027a4a2a1e753d4c4e747b54c5d4254 Mon Sep 17 00:00:00 2001 From: wojsmol Date: Tue, 21 Dec 2021 02:48:11 +0100 Subject: [PATCH 06/15] phpcbf --- src/Core_Command.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Core_Command.php b/src/Core_Command.php index 948220f5..2b33592d 100644 --- a/src/Core_Command.php +++ b/src/Core_Command.php @@ -1213,10 +1213,13 @@ public function update_db( $args, $assoc_args ) { if ( $dry_run ) { $cmd .= ' --dry-run'; } - $process = WP_CLI::runcommand( $cmd, [ - 'return' => 'all', - 'exit_error' => false, - ] ); + $process = WP_CLI::runcommand( + $cmd, + [ + 'return' => 'all', + 'exit_error' => false, + ] + ); if ( 0 === (int) $process->return_code ) { // See if we can parse the stdout if ( preg_match( '#Success: (.+)#', $process->stdout, $matches ) ) { From 8bf01711e24a32391d0200ebea25644eadb87760 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 10 Jan 2022 18:47:12 -0600 Subject: [PATCH 07/15] Adapt test for default scheme change --- features/core.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/core.feature b/features/core.feature index e3888b4b..8c24f82b 100644 --- a/features/core.feature +++ b/features/core.feature @@ -63,7 +63,7 @@ Feature: Manage WordPress installation When I run `wp eval 'echo home_url();'` Then STDOUT should be: """ - http://localhost:8001 + https://localhost:8001 """ Scenario: Install WordPress by prompting for the admin email and password From 168c1395432917a67bc7aedaaadcef33d9d4897b Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 10 Jan 2022 18:47:20 -0600 Subject: [PATCH 08/15] Allow Composer plugins to run --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5577cb35..7b253cbc 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,10 @@ }, "config": { "process-timeout": 7200, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "extra": { "branch-alias": { From e72d4379325f12c3350445e2e9004135e82e8c26 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 10 Jan 2022 18:54:52 -0600 Subject: [PATCH 09/15] Disable sidebar check on DB update command --- features/core-update-db.feature | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/features/core-update-db.feature b/features/core-update-db.feature index 4d34dd25..1c055254 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -37,9 +37,16 @@ Feature: Update core's database Scenario: Update db across network Given a WP multisite install + And a disable_sidebar_check.php file: + """ + Date: Mon, 10 Jan 2022 18:59:10 -0600 Subject: [PATCH 10/15] Adapt theme change --- features/core-update-db.feature | 4 ++-- features/core-update.feature | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/features/core-update-db.feature b/features/core-update-db.feature index 1c055254..120f6edc 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -44,7 +44,7 @@ Feature: Update core's database remove_action( 'after_switch_theme', '_wp_sidebars_changed' ); } ); """ - And I run `wp theme activate twentytwenty` + And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` 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` @@ -84,7 +84,7 @@ Feature: Update core's database remove_action( 'after_switch_theme', '_wp_sidebars_changed' ); } ); """ - And I run `wp theme activate twentytwenty` + And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` 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` diff --git a/features/core-update.feature b/features/core-update.feature index 2f8ac298..c470445a 100644 --- a/features/core-update.feature +++ b/features/core-update.feature @@ -2,7 +2,7 @@ Feature: Update WordPress core Scenario: Update from a ZIP file Given a WP install - And I run `wp theme activate twentytwenty` + And I try `wp theme install twentytwenty --activate` When I run `wp core download --version=3.9 --force` Then STDOUT should not be empty @@ -98,7 +98,7 @@ Feature: Update WordPress core Scenario: Core update from cache Given a WP install - And I run `wp theme activate twentytwenty` + And I try `wp theme install twentytwenty --activate` And an empty cache When I run `wp core update --version=3.9.1 --force` @@ -147,7 +147,7 @@ Feature: Update WordPress core Scenario: Ensure cached partial upgrades aren't used in full upgrade Given a WP install - And I run `wp theme activate twentytwenty` + And I try `wp theme install twentytwenty --activate` And an empty cache And a wp-content/mu-plugins/upgrade-override.php file: """ @@ -216,7 +216,7 @@ Feature: Update WordPress core @less-than-php-7.3 Scenario: Make sure files are cleaned up Given a WP install - And I run `wp theme activate twentytwenty` + And I try `wp theme install twentytwenty --activate` When I run `wp core update --version=4.4 --force` Then the wp-includes/rest-api.php file should exist Then the wp-includes/class-wp-comment.php file should exist @@ -251,7 +251,7 @@ Feature: Update WordPress core @less-than-php-7.3 Scenario: Minor update on an unlocalized WordPress release Given a WP install - And I run `wp theme activate twentytwenty` + And I try `wp theme install twentytwenty --activate` And an empty cache # If current WP_VERSION is nightly, trunk or old then from checksums might not exist, so STDERR may or may not be empty. From e6f100ef5df002913fa697e67243ea4208da37c8 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 10 Jan 2022 19:14:03 -0600 Subject: [PATCH 11/15] Switch theme before downgrading --- features/core-check-update.feature | 2 ++ features/core-update-db.feature | 2 ++ features/core-update.feature | 1 + 3 files changed, 5 insertions(+) diff --git a/features/core-check-update.feature b/features/core-check-update.feature index b955ed8b..f8745268 100644 --- a/features/core-check-update.feature +++ b/features/core-check-update.feature @@ -2,6 +2,7 @@ Feature: Check for more recent versions Scenario: Check for update via Version Check API Given a WP install + And I try `wp theme install twentytwenty --activate` When I run `wp core download --version=4.4 --force` Then STDOUT should not be empty @@ -42,6 +43,7 @@ Feature: Check for more recent versions Scenario: No minor updates for an unlocalized WordPress release Given a WP install + And I try `wp theme install twentytwenty --activate` # If current WP_VERSION is nightly, trunk or old then from checksums might not exist, so STDERR may or may not be empty. When I try `wp core download --version=4.0 --locale=es_ES --force` diff --git a/features/core-update-db.feature b/features/core-update-db.feature index 120f6edc..776ea715 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -2,6 +2,7 @@ Feature: Update core's database Scenario: Update db on a single site Given a WP install + And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` And I run `wp option update db_version 45805` @@ -19,6 +20,7 @@ Feature: Update core's database Scenario: Dry run update db on a single site Given a WP install + And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` And I run `wp option update db_version 45805` diff --git a/features/core-update.feature b/features/core-update.feature index c470445a..e255aa8a 100644 --- a/features/core-update.feature +++ b/features/core-update.feature @@ -64,6 +64,7 @@ Feature: Update WordPress core Scenario: Update to the latest minor release (PHP 7.1 compatible with WP >= 3.9) Given a WP install + And I try `wp theme install twentytwenty --activate` When I run `wp core download --version=3.9.9 --force` Then STDOUT should not be empty From a46351c0420805a9199ae49cf3f9bf8b6a1fa2ec Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 11 Jan 2022 18:18:34 -0600 Subject: [PATCH 12/15] Disable sidebar check when updating DB --- features/core-update-db.feature | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/features/core-update-db.feature b/features/core-update-db.feature index 776ea715..3d16991b 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -2,9 +2,16 @@ Feature: Update core's database Scenario: Update db on a single site Given a WP install + And a disable_sidebar_check.php file: + """ + Date: Tue, 11 Jan 2022 18:22:04 -0600 Subject: [PATCH 13/15] Adapt tests --- features/core-update.feature | 1 + features/core.feature | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/features/core-update.feature b/features/core-update.feature index e255aa8a..471e4096 100644 --- a/features/core-update.feature +++ b/features/core-update.feature @@ -35,6 +35,7 @@ Feature: Update WordPress core @less-than-php-7 Scenario: Update to the latest minor release Given a WP install + And I try `wp theme install twentytwenty --activate` When I run `wp core download --version=3.7.9 --force` Then STDOUT should not be empty diff --git a/features/core.feature b/features/core.feature index 8c24f82b..2d425d62 100644 --- a/features/core.feature +++ b/features/core.feature @@ -212,6 +212,13 @@ Feature: Manage WordPress installation Scenario: Install multisite from scratch, with MULTISITE already set in wp-config.php Given a WP multisite install + And a disable_default_scripts.php file: + """ + domain;'` From bbd14dbc6cf020b18e1e74d3523b17eade663947 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 11 Jan 2022 18:39:56 -0600 Subject: [PATCH 14/15] Bump requirement on tests framework --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7b253cbc..c63f574b 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "wp-cli/db-command": "^1.3 || ^2", "wp-cli/entity-command": "^1.3 || ^2", "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^3.1" + "wp-cli/wp-cli-tests": "^3.1.4" }, "config": { "process-timeout": 7200, From 531fd44d2b542ffb374e657c56cd66cdc4986a5f Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Thu, 20 Jan 2022 09:31:45 -0600 Subject: [PATCH 15/15] Remove disabling of default scripts --- features/core.feature | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/features/core.feature b/features/core.feature index 2d425d62..8c24f82b 100644 --- a/features/core.feature +++ b/features/core.feature @@ -212,13 +212,6 @@ Feature: Manage WordPress installation Scenario: Install multisite from scratch, with MULTISITE already set in wp-config.php Given a WP multisite install - And a disable_default_scripts.php file: - """ - domain;'`