Skip to content

Commit a46351c

Browse files
committed
Disable sidebar check when updating DB
1 parent e6f100e commit a46351c

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

features/core-update-db.feature

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +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+
"""
512
And I try `wp theme install twentytwenty --activate`
613
And I run `wp core download --version=5.4 --force`
7-
And I run `wp option update db_version 45805`
14+
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
815

916
When I run `wp core update-db`
1017
Then STDOUT should contain:
@@ -20,9 +27,16 @@ Feature: Update core's database
2027

2128
Scenario: Dry run update db on a single site
2229
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+
"""
2337
And I try `wp theme install twentytwenty --activate`
2438
And I run `wp core download --version=5.4 --force`
25-
And I run `wp option update db_version 45805`
39+
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
2640

2741
When I run `wp core update-db --dry-run`
2842
Then STDOUT should be:

0 commit comments

Comments
 (0)