Skip to content

Commit d58dcdd

Browse files
schlesseraclaude
andcommitted
Use cached plugin and theme installs in tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5fd1f9b commit d58dcdd

5 files changed

Lines changed: 69 additions & 18 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"wp-cli/db-command": "^1.3 || ^2 || ^3",
2121
"wp-cli/entity-command": "^1.3 || ^2 || ^3",
2222
"wp-cli/extension-command": "^1.2 || ^2 || ^3",
23-
"wp-cli/wp-cli-tests": "^5"
23+
"wp-cli/wp-cli-tests": "^5.4.0"
2424
},
2525
"config": {
2626
"process-timeout": 7200,

‎features/core-check-update-db.feature‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ Feature: Check if WordPress database update is needed
1414
}
1515
);
1616
"""
17-
And I try `wp theme install twentytwenty --activate`
17+
And these installed and active themes:
18+
"""
19+
twentytwenty
20+
"""
1821
And I run `wp core download --version=5.4 --force`
1922
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
2023

@@ -59,7 +62,10 @@ Feature: Check if WordPress database update is needed
5962
}
6063
);
6164
"""
62-
And I try `wp theme install twentytwenty --activate`
65+
And these installed and active themes:
66+
"""
67+
twentytwenty
68+
"""
6369
And I run `wp core download --version=6.6 --force`
6470
And I run `wp option update db_version 57155 --require=disable_sidebar_check.php`
6571
And I run `wp site option update wpmu_upgrade_site 57155`

‎features/core-check-update.feature‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ Feature: Check for more recent versions
44
@require-mysql
55
Scenario: Check for update via Version Check API
66
Given a WP install
7-
And I try `wp theme install twentytwenty --activate`
7+
And these installed and active themes:
8+
"""
9+
twentytwenty
10+
"""
811

912
When I run `wp core download --version=5.8 --force`
1013
Then STDOUT should not be empty

‎features/core-update-db.feature‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ Feature: Update core's database
1414
}
1515
);
1616
"""
17-
And I try `wp theme install twentytwenty --activate`
17+
And these installed and active themes:
18+
"""
19+
twentytwenty
20+
"""
1821
And I run `wp core download --version=5.4 --force`
1922
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
2023

@@ -44,7 +47,10 @@ Feature: Update core's database
4447
}
4548
);
4649
"""
47-
And I try `wp theme install twentytwenty --activate`
50+
And these installed and active themes:
51+
"""
52+
twentytwenty
53+
"""
4854
And I run `wp core download --version=5.4 --force`
4955
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
5056

@@ -75,7 +81,10 @@ Feature: Update core's database
7581
}
7682
);
7783
"""
78-
And I try `wp theme install twentytwenty --activate`
84+
And these installed and active themes:
85+
"""
86+
twentytwenty
87+
"""
7988
And I run `wp core download --version=5.4 --force`
8089
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
8190
And I run `wp site option update wpmu_upgrade_site 45805`
@@ -120,7 +129,10 @@ Feature: Update core's database
120129
}
121130
);
122131
"""
123-
And I try `wp theme install twentytwenty --activate`
132+
And these installed and active themes:
133+
"""
134+
twentytwenty
135+
"""
124136
And I run `wp core download --version=5.4 --force`
125137
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
126138
And I run `wp site option update wpmu_upgrade_site 45805`
@@ -177,7 +189,10 @@ Feature: Update core's database
177189
}
178190
);
179191
"""
180-
And I try `wp theme install twentytwenty --activate`
192+
And these installed and active themes:
193+
"""
194+
twentytwenty
195+
"""
181196
And I run `wp core download --version=5.4 --force`
182197
And I run `wp option update db_version 45805 --require=disable_sidebar_check.php`
183198
And I run `wp site option update wpmu_upgrade_site 45805`

‎features/core-update.feature‎

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ Feature: Update WordPress core
44
@require-mysql
55
Scenario: Update from a ZIP file
66
Given a WP install
7-
And I try `wp theme install twentytwenty --activate`
7+
And these installed and active themes:
8+
"""
9+
twentytwenty
10+
"""
811

912
When I run `wp core download --version=6.2 --force`
1013
Then STDOUT should not be empty
@@ -35,7 +38,10 @@ Feature: Update WordPress core
3538
@require-php-7.0
3639
Scenario: Output in JSON format
3740
Given a WP install
38-
And I try `wp theme install twentytwenty --activate`
41+
And these installed and active themes:
42+
"""
43+
twentytwenty
44+
"""
3945

4046
When I run `wp core download --version=6.6 --force`
4147
Then STDOUT should not be empty
@@ -56,7 +62,10 @@ Feature: Update WordPress core
5662
@require-php-7.0
5763
Scenario: Output in CSV format
5864
Given a WP install
59-
And I try `wp theme install twentytwenty --activate`
65+
And these installed and active themes:
66+
"""
67+
twentytwenty
68+
"""
6069

6170
When I run `wp core download --version=6.6 --force`
6271
Then STDOUT should not be empty
@@ -78,7 +87,10 @@ Feature: Update WordPress core
7887
@require-php-7.0
7988
Scenario: Output in table format
8089
Given a WP install
81-
And I try `wp theme install twentytwenty --activate`
90+
And these installed and active themes:
91+
"""
92+
twentytwenty
93+
"""
8294

8395
When I run `wp core download --version=6.6 --force`
8496
Then STDOUT should not be empty
@@ -99,7 +111,10 @@ Feature: Update WordPress core
99111
@require-mysql
100112
Scenario: Update to the latest minor release (PHP 7.2 compatible with WP >= 4.9)
101113
Given a WP install
102-
And I try `wp theme install twentytwenty --activate`
114+
And these installed and active themes:
115+
"""
116+
twentytwenty
117+
"""
103118

104119
When I run `wp core download --version=6.2.5 --force`
105120
Then STDOUT should contain:
@@ -135,7 +150,10 @@ Feature: Update WordPress core
135150
@require-mysql
136151
Scenario: Core update from cache
137152
Given a WP install
138-
And I try `wp theme install twentytwenty --activate`
153+
And these installed and active themes:
154+
"""
155+
twentytwenty
156+
"""
139157
And an empty cache
140158

141159
When I run `wp core update --version=6.2.5 --force`
@@ -184,7 +202,10 @@ Feature: Update WordPress core
184202

185203
Scenario: Ensure cached partial upgrades aren't used in full upgrade
186204
Given a WP install
187-
And I try `wp theme install twentytwenty --activate`
205+
And these installed and active themes:
206+
"""
207+
twentytwenty
208+
"""
188209
And an empty cache
189210
And a wp-content/mu-plugins/upgrade-override.php file:
190211
"""
@@ -259,7 +280,10 @@ Feature: Update WordPress core
259280
@less-than-php-7.3 @require-mysql
260281
Scenario: Make sure files are cleaned up
261282
Given a WP install
262-
And I try `wp theme install twentytwenty --activate`
283+
And these installed and active themes:
284+
"""
285+
twentytwenty
286+
"""
263287

264288
When I run `wp core update --version=4.4 --force`
265289
Then the wp-includes/rest-api.php file should exist
@@ -296,7 +320,10 @@ Feature: Update WordPress core
296320
@require-mysql
297321
Scenario: Make sure files are cleaned up with mixed case
298322
Given a WP install
299-
And I try `wp theme install twentytwenty --activate`
323+
And these installed and active themes:
324+
"""
325+
twentytwenty
326+
"""
300327

301328
When I run `wp core update --version=5.8 --force`
302329
Then the wp-includes/Requests/Transport/cURL.php file should exist

0 commit comments

Comments
 (0)