Skip to content

Commit 1f86336

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

4 files changed

Lines changed: 106 additions & 37 deletions

File tree

‎composer.json‎

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

‎features/language-core.feature‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ Feature: Manage core translation files for a WordPress install
343343
@require-wp-5.7 @require-mysql
344344
Scenario: Ensure correct language is installed for WP version
345345
Given a WP install
346-
And I try `wp theme install twentytwentyone`
346+
And these installed themes:
347+
"""
348+
twentytwentyone
349+
"""
347350
And I run `wp theme activate twentytwentyone`
348351
And an empty cache
349352
And I run `wp core download --version=5.6.14 --force`
@@ -364,7 +367,10 @@ Feature: Manage core translation files for a WordPress install
364367
@require-wp-4.0 @require-mysql
365368
Scenario: Ensure upgrader output is in English
366369
Given a WP install
367-
And I try `wp theme install twentytwentyone`
370+
And these installed themes:
371+
"""
372+
twentytwentyone
373+
"""
368374
And I run `wp theme activate twentytwentyone`
369375
And an empty cache
370376
And I run `wp core download --version=5.4.1 --force`

‎features/language-plugin.feature‎

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,11 @@ Feature: Manage plugin translation files for a WordPress install
272272
Scenario: Ensure correct language is installed for plugin version
273273
Given a WP install
274274
And an empty cache
275-
And I run `wp plugin install akismet --version=3.2 --force`
276-
And I run `wp plugin install jetpack --version=6.0 --force`
275+
And these installed plugins:
276+
"""
277+
akismet --version=3.2 --force
278+
jetpack --version=6.0 --force
279+
"""
277280

278281
When I run `wp language plugin install akismet de_DE_formal`
279282
Then STDOUT should contain:
@@ -309,9 +312,12 @@ Feature: Manage plugin translation files for a WordPress install
309312
| akismet | de_DE_formal | none | installed |
310313
| jetpack | de_DE | none | installed |
311314

312-
When I run `wp plugin install akismet --version=4.0 --force`
313-
And I run `wp plugin install jetpack --version=6.4 --force`
314-
And I run `wp language plugin list --all --fields=plugin,language,update,status`
315+
Given these installed plugins:
316+
"""
317+
akismet --version=4.0 --force
318+
jetpack --version=6.4 --force
319+
"""
320+
When I run `wp language plugin list --all --fields=plugin,language,update,status`
315321
Then STDOUT should be a table containing rows:
316322
| plugin | language | update | status |
317323
| akismet | de_DE_formal | available | installed |
@@ -351,8 +357,11 @@ Feature: Manage plugin translation files for a WordPress install
351357
Scenario: Ensure availability status is correct for each plugin
352358
Given a WP install
353359
And an empty cache
354-
And I run `wp plugin install akismet --version=3.2 --force`
355-
And I run `wp plugin install jetpack --version=6.0 --force`
360+
And these installed plugins:
361+
"""
362+
akismet --version=3.2 --force
363+
jetpack --version=6.0 --force
364+
"""
356365

357366
When I run `wp language plugin install akismet de_DE`
358367
Then STDOUT should contain:
@@ -367,9 +376,12 @@ Feature: Manage plugin translation files for a WordPress install
367376
"""
368377
And STDERR should be empty
369378

370-
When I run `wp plugin install akismet --version=4.0 --force`
371-
And I run `wp plugin install jetpack --version=6.4 --force`
372-
And I run `wp language plugin update jetpack`
379+
Given these installed plugins:
380+
"""
381+
akismet --version=4.0 --force
382+
jetpack --version=6.4 --force
383+
"""
384+
When I run `wp language plugin update jetpack`
373385
Then STDOUT should contain:
374386
"""
375387
Downloading translation from https://downloads.wordpress.org/translation/plugin/jetpack/6.4/de_DE.zip
@@ -388,8 +400,11 @@ Feature: Manage plugin translation files for a WordPress install
388400
And I run `wp plugin path`
389401
And save STDOUT as {PLUGIN_DIR}
390402
And an empty {PLUGIN_DIR} directory
391-
And I run `wp plugin install akismet --version=4.0 --force`
392-
And I run `wp plugin install jetpack --version=6.4 --force`
403+
And these installed plugins:
404+
"""
405+
akismet --version=4.0 --force
406+
jetpack --version=6.4 --force
407+
"""
393408

394409
When I try `wp language plugin install de_DE`
395410
Then the return code should be 1
@@ -478,8 +493,11 @@ Feature: Manage plugin translation files for a WordPress install
478493
When I run `wp language plugin install akismet de_DE`
479494
Then STDERR should be empty
480495

481-
When I run `wp plugin install akismet --version=4.0 --force`
482-
And I run `wp language plugin list akismet --fields=plugin,language,update,status`
496+
Given these installed plugins:
497+
"""
498+
akismet --version=4.0 --force
499+
"""
500+
When I run `wp language plugin list akismet --fields=plugin,language,update,status`
483501
Then STDOUT should be a table containing rows:
484502
| plugin | language | update | status |
485503
| akismet | de_DE | available | installed |
@@ -492,9 +510,15 @@ Feature: Manage plugin translation files for a WordPress install
492510
And STDERR should be empty
493511

494512
When I run `wp language plugin uninstall akismet de_DE`
495-
And I run `wp plugin install akismet --version=3.2 --force`
513+
And these installed plugins:
514+
"""
515+
akismet --version=3.2 --force
516+
"""
496517
And I run `wp language plugin install akismet de_DE`
497-
And I run `wp plugin install akismet --version=4.0 --force`
518+
And these installed plugins:
519+
"""
520+
akismet --version=4.0 --force
521+
"""
498522
And I run `wp language plugin update akismet --format=csv`
499523
Then STDOUT should contain:
500524
"""
@@ -507,9 +531,15 @@ Feature: Manage plugin translation files for a WordPress install
507531
And STDERR should be empty
508532

509533
When I run `wp language plugin uninstall akismet de_DE`
510-
And I run `wp plugin install akismet --version=3.2 --force`
534+
And these installed plugins:
535+
"""
536+
akismet --version=3.2 --force
537+
"""
511538
And I run `wp language plugin install akismet de_DE`
512-
And I run `wp plugin install akismet --version=4.0 --force`
539+
And these installed plugins:
540+
"""
541+
akismet --version=4.0 --force
542+
"""
513543
And I run `wp language plugin update akismet --format=summary`
514544
Then STDOUT should contain:
515545
"""
@@ -528,8 +558,11 @@ Feature: Manage plugin translation files for a WordPress install
528558
When I run `wp language plugin install akismet de_DE`
529559
Then STDERR should be empty
530560

531-
When I run `wp plugin install akismet --version=4.0 --force`
532-
And I run `wp language plugin list akismet --fields=plugin,language,update,status`
561+
Given these installed plugins:
562+
"""
563+
akismet --version=4.0 --force
564+
"""
565+
When I run `wp language plugin list akismet --fields=plugin,language,update,status`
533566
Then STDOUT should be a table containing rows:
534567
| plugin | language | update | status |
535568
| akismet | de_DE | available | installed |

‎features/language-theme.feature‎

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,22 @@ Feature: Manage theme translation files for a WordPress install
230230
Scenario: Ensure correct language is installed for theme version
231231
Given a WP install
232232
And an empty cache
233-
And I run `wp theme install twentyseventeen --version=1.0 --force`
233+
And these installed themes:
234+
"""
235+
twentyseventeen --version=1.0 --force
236+
"""
234237

235238
When I run `wp language theme install twentyseventeen de_DE`
236239
Then STDOUT should contain:
237240
"""
238241
Downloading translation from https://downloads.wordpress.org/translation/theme/twentyseventeen/1.0/de_DE.zip
239242
"""
240243

241-
When I run `wp theme install twentyseventeen --version=1.6 --force`
242-
And I run `wp language theme update twentyseventeen`
244+
Given these installed themes:
245+
"""
246+
twentyseventeen --version=1.6 --force
247+
"""
248+
When I run `wp language theme update twentyseventeen`
243249
Then STDOUT should contain:
244250
"""
245251
Downloading translation from https://downloads.wordpress.org/translation/theme/twentyseventeen/1.6/de_DE.zip
@@ -251,8 +257,11 @@ Feature: Manage theme translation files for a WordPress install
251257
And I run `wp theme path`
252258
And save STDOUT as {THEME_DIR}
253259
And an empty {THEME_DIR} directory
254-
And I run `wp theme install twentyseventeen --version=1.0 --force`
255-
And I run `wp theme install twentysixteen --version=1.0 --force`
260+
And these installed themes:
261+
"""
262+
twentyseventeen --version=1.0 --force
263+
twentysixteen --version=1.0 --force
264+
"""
256265

257266
When I try `wp language theme install de_DE`
258267
Then the return code should be 1
@@ -316,7 +325,10 @@ Feature: Manage theme translation files for a WordPress install
316325
Scenario: List languages by multiple statuses
317326
Given a WP install
318327
And an empty cache
319-
And I run `wp theme install twentyten --force`
328+
And these installed themes:
329+
"""
330+
twentyten --force
331+
"""
320332
And I run `wp language theme install twentyten nl_NL`
321333

322334
When I run `wp language theme list twentyten --fields=language,status --status=active,installed`
@@ -362,8 +374,11 @@ Feature: Manage theme translation files for a WordPress install
362374
When I run `wp language theme install twentyfifteen de_DE`
363375
Then STDERR should be empty
364376

365-
When I run `wp theme install twentyfifteen --version=2.5 --force`
366-
And I run `wp language theme list twentyfifteen --fields=theme,language,update,status`
377+
Given these installed themes:
378+
"""
379+
twentyfifteen --version=2.5 --force
380+
"""
381+
When I run `wp language theme list twentyfifteen --fields=theme,language,update,status`
367382
Then STDOUT should be a table containing rows:
368383
| theme | language | update | status |
369384
| twentyfifteen | de_DE | available | installed |
@@ -376,9 +391,15 @@ Feature: Manage theme translation files for a WordPress install
376391
And STDERR should be empty
377392

378393
When I run `wp language theme uninstall twentyfifteen de_DE`
379-
And I run `wp theme install twentyfifteen --version=2.0 --force`
394+
And these installed themes:
395+
"""
396+
twentyfifteen --version=2.0 --force
397+
"""
380398
And I run `wp language theme install twentyfifteen de_DE`
381-
And I run `wp theme install twentyfifteen --version=2.5 --force`
399+
And these installed themes:
400+
"""
401+
twentyfifteen --version=2.5 --force
402+
"""
382403
And I run `wp language theme update twentyfifteen --format=csv`
383404
Then STDOUT should contain:
384405
"""
@@ -391,9 +412,15 @@ Feature: Manage theme translation files for a WordPress install
391412
And STDERR should be empty
392413

393414
When I run `wp language theme uninstall twentyfifteen de_DE`
394-
And I run `wp theme install twentyfifteen --version=2.0 --force`
415+
And these installed themes:
416+
"""
417+
twentyfifteen --version=2.0 --force
418+
"""
395419
And I run `wp language theme install twentyfifteen de_DE`
396-
And I run `wp theme install twentyfifteen --version=2.5 --force`
420+
And these installed themes:
421+
"""
422+
twentyfifteen --version=2.5 --force
423+
"""
397424
And I run `wp language theme update twentyfifteen --format=summary`
398425
Then STDOUT should contain:
399426
"""
@@ -412,8 +439,11 @@ Feature: Manage theme translation files for a WordPress install
412439
When I run `wp language theme install twentyfifteen de_DE`
413440
Then STDERR should be empty
414441

415-
When I run `wp theme install twentyfifteen --version=2.5 --force`
416-
And I run `wp language theme list twentyfifteen --fields=theme,language,update,status`
442+
Given these installed themes:
443+
"""
444+
twentyfifteen --version=2.5 --force
445+
"""
446+
When I run `wp language theme list twentyfifteen --fields=theme,language,update,status`
417447
Then STDOUT should be a table containing rows:
418448
| theme | language | update | status |
419449
| twentyfifteen | de_DE | available | installed |

0 commit comments

Comments
 (0)