Skip to content

Commit dfdc1bd

Browse files
schlesseraclaude
andauthored
Use cached plugin and theme installs in tests (#21)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f0c08ac commit dfdc1bd

2 files changed

Lines changed: 45 additions & 12 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"require-dev": {
1212
"wp-cli/extension-command": "^2 || ^3",
13-
"wp-cli/wp-cli-tests": "^5"
13+
"wp-cli/wp-cli-tests": "^5.4.0"
1414
},
1515
"config": {
1616
"process-timeout": 7200,

‎features/block-template.feature‎

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ Feature: Block template commands
33
@require-wp-5.9
44
Scenario: List block templates
55
Given a WP install
6-
And I try `wp theme install twentytwentyfour --activate`
6+
And these installed and active themes:
7+
"""
8+
twentytwentyfour
9+
"""
710

811
When I run `wp block template list --format=count`
912
Then STDOUT should be a number
@@ -17,7 +20,10 @@ Feature: Block template commands
1720
@require-wp-5.9
1821
Scenario: List template parts
1922
Given a WP install
20-
And I try `wp theme install twentytwentyfour --activate`
23+
And these installed and active themes:
24+
"""
25+
twentytwentyfour
26+
"""
2127

2228
When I run `wp block template list --type=wp_template_part --format=count`
2329
Then STDOUT should be a number
@@ -28,15 +34,21 @@ Feature: Block template commands
2834
@require-wp-5.9
2935
Scenario: Filter templates by source
3036
Given a WP install
31-
And I try `wp theme install twentytwentyfour --activate`
37+
And these installed and active themes:
38+
"""
39+
twentytwentyfour
40+
"""
3241

3342
When I run `wp block template list --source=theme --format=count`
3443
Then STDOUT should be a number
3544

3645
@require-wp-5.9
3746
Scenario: Filter templates by slug
3847
Given a WP install
39-
And I try `wp theme install twentytwentyfour --activate`
48+
And these installed and active themes:
49+
"""
50+
twentytwentyfour
51+
"""
4052

4153
# Filter by single slug
4254
When I run `wp block template list --slug=index --field=slug`
@@ -52,7 +64,10 @@ Feature: Block template commands
5264
@require-wp-5.9
5365
Scenario: Filter template parts by area
5466
Given a WP install
55-
And I try `wp theme install twentytwentyfour --activate`
67+
And these installed and active themes:
68+
"""
69+
twentytwentyfour
70+
"""
5671

5772
When I run `wp block template list --type=wp_template_part --area=header --field=slug`
5873
Then STDOUT should contain:
@@ -63,7 +78,10 @@ Feature: Block template commands
6378
@require-wp-5.9
6479
Scenario: Get a block template
6580
Given a WP install
66-
And I try `wp theme install twentytwentyfour --activate`
81+
And these installed and active themes:
82+
"""
83+
twentytwentyfour
84+
"""
6785

6886
# Get the first template ID
6987
When I run `wp block template list --field=id`
@@ -91,7 +109,10 @@ Feature: Block template commands
91109
@require-wp-5.9
92110
Scenario: Export template to stdout
93111
Given a WP install
94-
And I try `wp theme install twentytwentyfour --activate`
112+
And these installed and active themes:
113+
"""
114+
twentytwentyfour
115+
"""
95116

96117
# Get the first template ID using %s pattern to capture first line
97118
When I run `wp block template list --field=id`
@@ -130,7 +151,10 @@ Feature: Block template commands
130151
@require-wp-5.9
131152
Scenario: Export template to file
132153
Given a WP install
133-
And I try `wp theme install twentytwentyfour --activate`
154+
And these installed and active themes:
155+
"""
156+
twentytwentyfour
157+
"""
134158

135159
When I run `wp block template list --field=id`
136160
Then STDOUT should not be empty
@@ -159,7 +183,10 @@ Feature: Block template commands
159183
@require-wp-5.9
160184
Scenario: Filter template parts by invalid area returns empty
161185
Given a WP install
162-
And I try `wp theme install twentytwentyfour --activate`
186+
And these installed and active themes:
187+
"""
188+
twentytwentyfour
189+
"""
163190

164191
When I run `wp block template list --type=wp_template_part --area=nonexistent --format=count`
165192
Then STDOUT should be:
@@ -170,7 +197,10 @@ Feature: Block template commands
170197
@require-wp-5.9
171198
Scenario: Export template creates subdirectories
172199
Given a WP install
173-
And I try `wp theme install twentytwentyfour --activate`
200+
And these installed and active themes:
201+
"""
202+
twentytwentyfour
203+
"""
174204

175205
When I run `wp block template list --field=id`
176206
Then STDOUT should not be empty
@@ -186,7 +216,10 @@ Feature: Block template commands
186216
@require-wp-5.9
187217
Scenario: Export fails when both --file and --dir are provided
188218
Given a WP install
189-
And I try `wp theme install twentytwentyfour --activate`
219+
And these installed and active themes:
220+
"""
221+
twentytwentyfour
222+
"""
190223

191224
When I run `wp block template list --field=id`
192225
Then STDOUT should not be empty

0 commit comments

Comments
 (0)