@@ -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`
0 commit comments