Skip to content

Commit 43acb45

Browse files
Copilotswissspidy
andcommitted
Add complete database update steps to multinetwork test
Include WordPress downgrade, database version downgrade, site creation, and verification of the actual update-db command execution and success. Co-authored-by: swissspidy <[email protected]>
1 parent b9f51da commit 43acb45

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

features/core-update-db.feature

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ Feature: Update core's database
151151
{UPDATE_VERSION}
152152
"""
153153

154+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
155+
@require-mysql
154156
Scenario: Update db respects current network in multinetwork setup
155157
Given a WP multisite install
156158
And a disable_sidebar_check.php file:
@@ -161,14 +163,33 @@ Feature: Update core's database
161163
} );
162164
"""
163165
And I try `wp theme install twentytwenty --activate`
166+
And I run `wp core download --version=5.4 --force`
167+
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
168+
And I run `wp site option update wpmu_upgrade_site 45805`
169+
And I run `wp site create --slug=foo`
170+
And I run `wp site create --slug=bar`
164171

165-
# Verify that network ID is determined correctly
166172
When I run `wp eval "echo defined('SITE_ID_CURRENT_SITE') ? SITE_ID_CURRENT_SITE : 'not defined';"`
167173
Then STDOUT should contain:
168174
"""
169175
1
170176
"""
171177

178+
When I run `wp site option get wpmu_upgrade_site`
179+
Then save STDOUT as {UPDATE_VERSION}
180+
181+
When I run `wp core update-db --network`
182+
Then STDOUT should contain:
183+
"""
184+
Success: WordPress database upgraded on 3/3 sites.
185+
"""
186+
187+
When I run `wp site option get wpmu_upgrade_site`
188+
Then STDOUT should not contain:
189+
"""
190+
{UPDATE_VERSION}
191+
"""
192+
172193
Scenario: Ensure update-db sets WP_INSTALLING constant
173194
Given a WP install
174195
And a before.php file:

0 commit comments

Comments
 (0)