Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"require-dev": {
"wp-cli/extension-command": "^2 || ^3",
"wp-cli/wp-cli-tests": "^5"
"wp-cli/wp-cli-tests": "dev-cached-extension-installs as 5.3.99"
},
"config": {
"process-timeout": 7200,
Expand Down
55 changes: 44 additions & 11 deletions features/block-template.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ Feature: Block template commands
@require-wp-5.9
Scenario: List block templates
Given a WP install
And I try `wp theme install twentytwentyfour --activate`
And these installed and active themes:
"""
twentytwentyfour
"""

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

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

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

@require-wp-5.9
Scenario: Filter templates by slug
Given a WP install
And I try `wp theme install twentytwentyfour --activate`
And these installed and active themes:
"""
twentytwentyfour
"""

# Filter by single slug
When I run `wp block template list --slug=index --field=slug`
Expand All @@ -52,7 +64,10 @@ Feature: Block template commands
@require-wp-5.9
Scenario: Filter template parts by area
Given a WP install
And I try `wp theme install twentytwentyfour --activate`
And these installed and active themes:
"""
twentytwentyfour
"""

When I run `wp block template list --type=wp_template_part --area=header --field=slug`
Then STDOUT should contain:
Expand All @@ -63,7 +78,10 @@ Feature: Block template commands
@require-wp-5.9
Scenario: Get a block template
Given a WP install
And I try `wp theme install twentytwentyfour --activate`
And these installed and active themes:
"""
twentytwentyfour
"""

# Get the first template ID
When I run `wp block template list --field=id`
Expand Down Expand Up @@ -91,7 +109,10 @@ Feature: Block template commands
@require-wp-5.9
Scenario: Export template to stdout
Given a WP install
And I try `wp theme install twentytwentyfour --activate`
And these installed and active themes:
"""
twentytwentyfour
"""

# Get the first template ID using %s pattern to capture first line
When I run `wp block template list --field=id`
Expand Down Expand Up @@ -130,7 +151,10 @@ Feature: Block template commands
@require-wp-5.9
Scenario: Export template to file
Given a WP install
And I try `wp theme install twentytwentyfour --activate`
And these installed and active themes:
"""
twentytwentyfour
"""

When I run `wp block template list --field=id`
Then STDOUT should not be empty
Expand Down Expand Up @@ -159,7 +183,10 @@ Feature: Block template commands
@require-wp-5.9
Scenario: Filter template parts by invalid area returns empty
Given a WP install
And I try `wp theme install twentytwentyfour --activate`
And these installed and active themes:
"""
twentytwentyfour
"""

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

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

When I run `wp block template list --field=id`
Then STDOUT should not be empty
Expand Down
Loading