Skip to content

Commit 5bcfd6a

Browse files
authored
Merge pull request #197 from wojsmol/download_package-signature
2 parents 04ceafd + 531fd44 commit 5bcfd6a

File tree

7 files changed

+61
-14
lines changed

7 files changed

+61
-14
lines changed

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@
1313
],
1414
"require": {
1515
"composer/semver": "^1.4 || ^2 || ^3",
16-
"wp-cli/wp-cli": "^2.5"
16+
"wp-cli/wp-cli": "^2.5.1"
1717
},
1818
"require-dev": {
1919
"wp-cli/checksum-command": "^1 || ^2",
2020
"wp-cli/db-command": "^1.3 || ^2",
2121
"wp-cli/entity-command": "^1.3 || ^2",
2222
"wp-cli/extension-command": "^1.2 || ^2",
23-
"wp-cli/wp-cli-tests": "^3.0.11"
23+
"wp-cli/wp-cli-tests": "^3.1.4"
2424
},
2525
"config": {
2626
"process-timeout": 7200,
27-
"sort-packages": true
27+
"sort-packages": true,
28+
"allow-plugins": {
29+
"dealerdirect/phpcodesniffer-composer-installer": true
30+
}
2831
},
2932
"extra": {
3033
"branch-alias": {

features/core-check-update.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Feature: Check for more recent versions
22

33
Scenario: Check for update via Version Check API
44
Given a WP install
5+
And I try `wp theme install twentytwenty --activate`
56

67
When I run `wp core download --version=4.4 --force`
78
Then STDOUT should not be empty
@@ -42,6 +43,7 @@ Feature: Check for more recent versions
4243

4344
Scenario: No minor updates for an unlocalized WordPress release
4445
Given a WP install
46+
And I try `wp theme install twentytwenty --activate`
4547

4648
# If current WP_VERSION is nightly, trunk or old then from checksums might not exist, so STDERR may or may not be empty.
4749
When I try `wp core download --version=4.0 --locale=es_ES --force`

features/core-update-db.feature

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ Feature: Update core's database
22

33
Scenario: Update db on a single site
44
Given a WP install
5+
And a disable_sidebar_check.php file:
6+
"""
7+
<?php
8+
WP_CLI::add_wp_hook( 'init', static function () {
9+
remove_action( 'after_switch_theme', '_wp_sidebars_changed' );
10+
} );
11+
"""
12+
And I try `wp theme install twentytwenty --activate`
513
And I run `wp core download --version=5.4 --force`
6-
And I run `wp option update db_version 45805`
14+
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
715

816
When I run `wp core update-db`
917
Then STDOUT should contain:
@@ -19,8 +27,16 @@ Feature: Update core's database
1927

2028
Scenario: Dry run update db on a single site
2129
Given a WP install
30+
And a disable_sidebar_check.php file:
31+
"""
32+
<?php
33+
WP_CLI::add_wp_hook( 'init', static function () {
34+
remove_action( 'after_switch_theme', '_wp_sidebars_changed' );
35+
} );
36+
"""
37+
And I try `wp theme install twentytwenty --activate`
2238
And I run `wp core download --version=5.4 --force`
23-
And I run `wp option update db_version 45805`
39+
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
2440

2541
When I run `wp core update-db --dry-run`
2642
Then STDOUT should be:
@@ -37,8 +53,16 @@ Feature: Update core's database
3753

3854
Scenario: Update db across network
3955
Given a WP multisite install
56+
And a disable_sidebar_check.php file:
57+
"""
58+
<?php
59+
WP_CLI::add_wp_hook( 'init', static function () {
60+
remove_action( 'after_switch_theme', '_wp_sidebars_changed' );
61+
} );
62+
"""
63+
And I try `wp theme install twentytwenty --activate`
4064
And I run `wp core download --version=5.4 --force`
41-
And I run `wp option update db_version 45805`
65+
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
4266
And I run `wp site option update wpmu_upgrade_site 45805`
4367
And I run `wp site create --slug=foo`
4468
And I run `wp site create --slug=bar`
@@ -69,8 +93,16 @@ Feature: Update core's database
6993

7094
Scenario: Update db across network, dry run
7195
Given a WP multisite install
96+
And a disable_sidebar_check.php file:
97+
"""
98+
<?php
99+
WP_CLI::add_wp_hook( 'init', static function () {
100+
remove_action( 'after_switch_theme', '_wp_sidebars_changed' );
101+
} );
102+
"""
103+
And I try `wp theme install twentytwenty --activate`
72104
And I run `wp core download --version=5.4 --force`
73-
And I run `wp option update db_version 45805`
105+
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
74106
And I run `wp site option update wpmu_upgrade_site 45805`
75107
And I run `wp site create --slug=foo`
76108
And I run `wp site create --slug=bar`

features/core-update.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Feature: Update WordPress core
22

33
Scenario: Update from a ZIP file
44
Given a WP install
5+
And I try `wp theme install twentytwenty --activate`
56

67
When I run `wp core download --version=3.9 --force`
78
Then STDOUT should not be empty
@@ -34,6 +35,7 @@ Feature: Update WordPress core
3435
@less-than-php-7
3536
Scenario: Update to the latest minor release
3637
Given a WP install
38+
And I try `wp theme install twentytwenty --activate`
3739

3840
When I run `wp core download --version=3.7.9 --force`
3941
Then STDOUT should not be empty
@@ -63,6 +65,7 @@ Feature: Update WordPress core
6365

6466
Scenario: Update to the latest minor release (PHP 7.1 compatible with WP >= 3.9)
6567
Given a WP install
68+
And I try `wp theme install twentytwenty --activate`
6669

6770
When I run `wp core download --version=3.9.9 --force`
6871
Then STDOUT should not be empty
@@ -97,6 +100,7 @@ Feature: Update WordPress core
97100

98101
Scenario: Core update from cache
99102
Given a WP install
103+
And I try `wp theme install twentytwenty --activate`
100104
And an empty cache
101105

102106
When I run `wp core update --version=3.9.1 --force`
@@ -145,6 +149,7 @@ Feature: Update WordPress core
145149

146150
Scenario: Ensure cached partial upgrades aren't used in full upgrade
147151
Given a WP install
152+
And I try `wp theme install twentytwenty --activate`
148153
And an empty cache
149154
And a wp-content/mu-plugins/upgrade-override.php file:
150155
"""
@@ -213,6 +218,7 @@ Feature: Update WordPress core
213218
@less-than-php-7.3
214219
Scenario: Make sure files are cleaned up
215220
Given a WP install
221+
And I try `wp theme install twentytwenty --activate`
216222
When I run `wp core update --version=4.4 --force`
217223
Then the wp-includes/rest-api.php file should exist
218224
Then the wp-includes/class-wp-comment.php file should exist
@@ -247,6 +253,7 @@ Feature: Update WordPress core
247253
@less-than-php-7.3
248254
Scenario: Minor update on an unlocalized WordPress release
249255
Given a WP install
256+
And I try `wp theme install twentytwenty --activate`
250257
And an empty cache
251258

252259
# If current WP_VERSION is nightly, trunk or old then from checksums might not exist, so STDERR may or may not be empty.

features/core.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Feature: Manage WordPress installation
6363
When I run `wp eval 'echo home_url();'`
6464
Then STDOUT should be:
6565
"""
66-
http://localhost:8001
66+
https://localhost:8001
6767
"""
6868
6969
Scenario: Install WordPress by prompting for the admin email and password

src/Core_Command.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,10 +1213,13 @@ public function update_db( $args, $assoc_args ) {
12131213
if ( $dry_run ) {
12141214
$cmd .= ' --dry-run';
12151215
}
1216-
$process = WP_CLI::runcommand( $cmd, [
1217-
'return' => 'all',
1218-
'exit_error' => false,
1219-
] );
1216+
$process = WP_CLI::runcommand(
1217+
$cmd,
1218+
[
1219+
'return' => 'all',
1220+
'exit_error' => false,
1221+
]
1222+
);
12201223
if ( 0 === (int) $process->return_code ) {
12211224
// See if we can parse the stdout
12221225
if ( preg_match( '#Success: (.+)#', $process->stdout, $matches ) ) {

src/WP_CLI/Core/CoreUpgrader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public function __construct( $skin = null, $insecure = false ) {
4141
*
4242
* @param string $package The URI of the package. If this is the full path to an
4343
* existing local file, it will be returned untouched.
44-
* @param bool $check_signatures Whether to validate file signatures. Default true.
44+
* @param bool $check_signatures Whether to validate file signatures. Default false.
4545
* @param array $hook_extra Extra arguments to pass to the filter hooks. Default empty array.
4646
* @return string|WP_Error The full path to the downloaded package file, or a WP_Error object.
4747
*/
48-
public function download_package( $package, $check_signatures = true, $hook_extra = [] ) {
48+
public function download_package( $package, $check_signatures = false, $hook_extra = [] ) {
4949

5050
/**
5151
* Filter whether to return the package.

0 commit comments

Comments
 (0)