Skip to content

Commit 054de43

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

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"require-dev": {
1818
"wp-cli/extension-command": "^1.2 || ^2 || ^3",
19-
"wp-cli/wp-cli-tests": "^5"
19+
"wp-cli/wp-cli-tests": "^5.4.0"
2020
},
2121
"config": {
2222
"process-timeout": 7200,

‎features/scaffold-block.feature‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ Feature: WordPress block code scaffolding
55
And I run `wp scaffold plugin movies`
66
And I run `wp plugin path movies --dir`
77
And save STDOUT as {PLUGIN_DIR}
8-
And I run `wp theme install twentytwelve --activate --force`
8+
And these installed and active themes:
9+
"""
10+
twentytwelve --force
11+
"""
912
And I run `wp theme path twentytwelve --dir`
1013
And save STDOUT as {THEME_DIR}
1114

‎features/scaffold-lint.feature‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ Feature: Lint scaffolded code
2626
Then the return code should be 0
2727

2828
Scenario: Scaffold post-type and lint it
29-
When I run `wp theme install twentytwentyone --force --activate`
30-
And I run `wp eval 'echo STYLESHEETPATH;'`
29+
Given these installed and active themes:
30+
"""
31+
twentytwentyone --force
32+
"""
33+
When I run `wp eval 'echo STYLESHEETPATH;'`
3134
And save STDOUT as {STYLESHEETPATH}
3235

3336
And I run `wp scaffold post-type movie --theme`
@@ -38,8 +41,11 @@ Feature: Lint scaffolded code
3841
Then the return code should be 0
3942

4043
Scenario: Scaffold taxonomy and lint it
41-
When I run `wp theme install twentytwentyone --force --activate`
42-
And I run `wp eval 'echo STYLESHEETPATH;'`
44+
Given these installed and active themes:
45+
"""
46+
twentytwentyone --force
47+
"""
48+
When I run `wp eval 'echo STYLESHEETPATH;'`
4349
And save STDOUT as {STYLESHEETPATH}
4450

4551
And I run `wp scaffold taxonomy genre --theme`
@@ -61,8 +67,11 @@ Feature: Lint scaffolded code
6167
Then the return code should be 0
6268

6369
Scenario: Scaffold child theme and lint it
64-
When I run `wp theme install twentytwentyone --force --activate`
65-
And I run `wp theme path`
70+
Given these installed and active themes:
71+
"""
72+
twentytwentyone --force
73+
"""
74+
When I run `wp theme path`
6675
And save STDOUT as {THEME_DIR}
6776

6877
And I run `wp scaffold child-theme test-child --parent_theme=twentytwentyone`

‎features/scaffold-theme-tests.feature‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ Feature: Scaffold theme unit tests
22

33
Background:
44
Given a WP install
5-
And I try `wp theme install twentytwelve --force`
5+
And these installed themes:
6+
"""
7+
twentytwelve --force
8+
"""
69
And I run `wp scaffold child-theme t12child --parent_theme=twentytwelve`
710

811
When I run `wp theme path`

0 commit comments

Comments
 (0)