-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathblock.feature
More file actions
71 lines (62 loc) · 2 KB
/
block.feature
File metadata and controls
71 lines (62 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Feature: Manage WordPress block types
Background:
Given a WP install
@require-wp-5.0
Scenario: Listing block types
When I run `wp block list --format=csv`
Then STDOUT should contain:
"""
name,title
"""
And STDOUT should contain:
"""
core/paragraph
"""
@require-wp-5.0
Scenario: Listing block types with specific fields
When I run `wp block list --fields=name,title,category`
Then STDOUT should be a table containing rows:
| name | title | category |
| core/paragraph | Paragraph | text |
@require-wp-5.0
Scenario: Getting a specific block type
When I run `wp block get core/paragraph --fields=name,title,category`
Then STDOUT should be a table containing rows:
| Field | Value |
| name | core/paragraph |
| title | Paragraph |
| category | text |
@require-wp-5.0
Scenario: Getting a non-existent block type
When I try `wp block get core/nonexistent-block`
Then STDERR should contain:
"""
Error: Block type 'core/nonexistent-block' is not registered.
"""
And the return code should be 1
@require-wp-5.0
Scenario: Getting a specific field from a block type
When I run `wp block get core/paragraph --field=title`
Then STDOUT should be:
"""
Paragraph
"""
@require-wp-5.0
Scenario: Listing block types in JSON format
When I run `wp block list --format=json`
Then STDOUT should contain:
"""
{"name":"core\/paragraph","title":"Paragraph","description":"Start with the basic building block of all narrative.","category":"text"}
"""
@require-wp-5.0
Scenario: Count block types
When I run `wp block list --format=count`
Then STDOUT should match /^\d+$/
@less-than-wp-5.0
Scenario: Block commands require WordPress 5.0+
When I try `wp block list`
Then STDERR should contain:
"""
Error: Requires WordPress 5.0 or greater.
"""
And the return code should be 1