diff --git a/features/block-binding.feature b/features/block-binding.feature index 41a7858..f8294c7 100644 --- a/features/block-binding.feature +++ b/features/block-binding.feature @@ -1,5 +1,16 @@ Feature: Block binding commands + @less-than-wp-6.5 + Scenario: Block binding commands not available on WP < 6.5 + Given a WP install + + When I try `wp block binding list` + Then STDERR should contain: + """ + Requires WordPress 6.5 or greater. + """ + And the return code should be 1 + @require-wp-6.5 Scenario: List block binding sources Given a WP install @@ -36,3 +47,37 @@ Feature: Block binding commands not registered """ And the return code should be 1 + + @require-wp-6.5 + Scenario: List binding sources in various formats + Given a WP install + + When I run `wp block binding list --fields=name --format=table` + Then STDOUT should be a table containing rows: + | name | + | core/post-meta | + + When I run `wp block binding list --format=yaml` + Then STDOUT should contain: + """ + name: core/post-meta + """ + + When I run `wp block binding list --format=csv` + Then STDOUT should contain: + """ + name, + """ + + @require-wp-6.5 + Scenario: Get binding source field values + Given a WP install + + When I run `wp block binding get core/post-meta --field=name` + Then STDOUT should be: + """ + core/post-meta + """ + + When I run `wp block binding get core/post-meta --field=label` + Then STDOUT should not be empty diff --git a/features/block-pattern-category.feature b/features/block-pattern-category.feature index e10a872..3bb75e0 100644 --- a/features/block-pattern-category.feature +++ b/features/block-pattern-category.feature @@ -40,3 +40,31 @@ Feature: Block pattern category commands not registered """ And the return code should be 1 + + @require-wp-5.5 + Scenario: List pattern categories in various formats + Given a WP install + + When I run `wp block pattern-category list --fields=name --format=table` + Then STDOUT should be a table containing rows: + | name | + | text | + + When I run `wp block pattern-category list --format=csv` + Then STDOUT should contain: + """ + name, + """ + + When I run `wp block pattern-category list --format=yaml` + Then STDOUT should contain: + """ + name: text + """ + + @require-wp-5.5 + Scenario: Get pattern category label field + Given a WP install + + When I run `wp block pattern-category get text --field=label` + Then STDOUT should not be empty diff --git a/features/block-pattern.feature b/features/block-pattern.feature index 83fd1f7..b03daff 100644 --- a/features/block-pattern.feature +++ b/features/block-pattern.feature @@ -62,3 +62,37 @@ Feature: Block pattern commands not registered """ And the return code should be 1 + + @require-wp-5.5 + Scenario: Search patterns with no matches returns empty + Given a WP install + + When I run `wp block pattern list --search=xyznonexistent123 --format=count` + Then STDOUT should be: + """ + 0 + """ + + @require-wp-5.5 + Scenario: Get pattern content field + Given a WP install + + When I run `wp block pattern list --field=name` + Then STDOUT should not be empty + And save STDOUT '%s' as {PATTERN_NAME} + + When I run `wp block pattern get {PATTERN_NAME} --field=content` + Then STDOUT should contain: + """ +
X
' --porcelain` + Then save STDOUT as {PATTERN_ID} + + When I run `wp block synced-pattern list --fields=ID --format=table` + Then STDOUT should be a table containing rows: + | ID | + | {PATTERN_ID} | + + When I run `wp block synced-pattern list --format=csv` + Then STDOUT should contain: + """ + ID, + """ + + When I run `wp block synced-pattern list --format=yaml` + Then STDOUT should contain: + """ + post_title: Format Test + """ + + # Cleanup + When I run `wp block synced-pattern delete {PATTERN_ID} --force` + Then STDOUT should contain: + """ + Deleted + """ diff --git a/features/block-template.feature b/features/block-template.feature index b01478a..7943a0c 100644 --- a/features/block-template.feature +++ b/features/block-template.feature @@ -126,3 +126,75 @@ Feature: Block template commands not found """ And the return code should be 1 + + @require-wp-5.9 + Scenario: Export template to file + Given a WP install + And I try `wp theme install twentytwentyfour --activate` + + When I run `wp block template list --field=id` + Then STDOUT should not be empty + And save STDOUT '%s' as {TEMPLATE_ID} + + When I run `wp block template export {TEMPLATE_ID} --file=exported-template.html` + Then STDOUT should contain: + """ + Success: + """ + And the exported-template.html file should contain: + """ +