Skip to content

Commit 37a685e

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

2 files changed

Lines changed: 33 additions & 9 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wp-cli/entity-command": "^1.3 || ^2 || ^3",
2020
"wp-cli/export-command": "^1 || ^2 || ^3",
2121
"wp-cli/extension-command": "^1.2 || ^2 || ^3",
22-
"wp-cli/wp-cli-tests": "^5"
22+
"wp-cli/wp-cli-tests": "^5.4.0"
2323
},
2424
"repositories": [
2525
{

‎features/import.feature‎

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ Feature: Import content.
306306
@require-wp-5.2 @require-mysql
307307
Scenario: Indicate current file when importing
308308
Given a WP install
309-
And I run `wp plugin install --activate wordpress-importer`
309+
And these installed and active plugins:
310+
"""
311+
wordpress-importer
312+
"""
310313

311314
When I run `wp export --filename_format=wordpress.{n}.xml`
312315
Then save STDOUT 'Writing to file %s' as {EXPORT_FILE}
@@ -323,7 +326,10 @@ Feature: Import content.
323326
@require-wp-5.2
324327
Scenario: Handling of non-existing files and directories
325328
Given a WP install
326-
And I run `wp plugin install --activate wordpress-importer`
329+
And these installed and active plugins:
330+
"""
331+
wordpress-importer
332+
"""
327333
And I run `wp export`
328334
And save STDOUT 'Writing to file %s' as {EXPORT_FILE}
329335
And an empty 'empty_test_directory' directory
@@ -403,7 +409,10 @@ Feature: Import content.
403409
@require-wp-5.2 @require-mysql
404410
Scenario: Specifying a non-existent importer class produces an error
405411
Given a WP install
406-
And I run `wp plugin install wordpress-importer --activate`
412+
And these installed and active plugins:
413+
"""
414+
wordpress-importer
415+
"""
407416

408417
When I run `wp export`
409418
Then save STDOUT 'Writing to file %s' as {EXPORT_FILE}
@@ -418,7 +427,10 @@ Feature: Import content.
418427
@require-wp-5.2 @require-mysql
419428
Scenario: Specifying an importer class that is not a subclass of WP_Import produces an error
420429
Given a WP install
421-
And I run `wp plugin install wordpress-importer --activate`
430+
And these installed and active plugins:
431+
"""
432+
wordpress-importer
433+
"""
422434

423435
When I run `wp export`
424436
Then save STDOUT 'Writing to file %s' as {EXPORT_FILE}
@@ -433,7 +445,10 @@ Feature: Import content.
433445
@require-wp-5.2 @require-mysql
434446
Scenario: Specifying a valid custom importer subclass succeeds
435447
Given a WP install
436-
And I run `wp plugin install wordpress-importer --activate`
448+
And these installed and active plugins:
449+
"""
450+
wordpress-importer
451+
"""
437452
And a wp-content/mu-plugins/custom-importer.php file:
438453
"""
439454
<?php
@@ -461,7 +476,10 @@ Feature: Import content.
461476
@require-wp-5.2 @require-mysql
462477
Scenario: Import from STDIN
463478
Given a WP install
464-
And I run `wp plugin install wordpress-importer --activate`
479+
And these installed and active plugins:
480+
"""
481+
wordpress-importer
482+
"""
465483
And I run `wp site empty --yes`
466484
And I run `wp post generate --post_type=post --count=2`
467485

@@ -503,7 +521,10 @@ Feature: Import content.
503521
@require-wp-5.2 @require-mysql
504522
Scenario: Import from a URL
505523
Given a WP install
506-
And I run `wp plugin install wordpress-importer --activate`
524+
And these installed and active plugins:
525+
"""
526+
wordpress-importer
527+
"""
507528

508529
When I run `wp import https://raw.githubusercontent.com/WordPress/theme-test-data/b47acf980696897936265182cb684dca648476c7/theme-preview.xml --authors=skip`
509530
Then STDOUT should contain:
@@ -523,7 +544,10 @@ Feature: Import content.
523544
@require-wp-5.2 @require-mysql
524545
Scenario: Import attachments from a local source directory
525546
Given a WP install
526-
And I run `wp plugin install wordpress-importer --activate`
547+
And these installed and active plugins:
548+
"""
549+
wordpress-importer
550+
"""
527551
And I run `mkdir sources`
528552
And I run `php -r "file_put_contents('sources/test.png', base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=='));"`
529553
And a wxr-with-attachment.xml file:

0 commit comments

Comments
 (0)