-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathpattern.feature
More file actions
57 lines (48 loc) · 1.48 KB
/
pattern.feature
File metadata and controls
57 lines (48 loc) · 1.48 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
Feature: Manage WordPress block patterns
Background:
Given a WP install
@require-wp-5.5
Scenario: Listing block patterns
When I run `wp pattern list --format=csv`
Then STDOUT should contain:
"""
name,title
"""
When I run `wp pattern list --format=json`
Then STDOUT should be JSON containing:
"""
[{"name":"core\/query-standard-posts","title":"Standard"}]
"""
@require-wp-5.5
Scenario: Filtering block patterns by category
When I run `wp pattern list --category=buttons --format=count`
Then STDOUT should match /^\d+$/
@require-wp-5.5
Scenario: Getting a specific block pattern
When I run `wp pattern list --format=csv --fields=name`
Then STDOUT should contain:
"""
name
"""
When I run `wp pattern list --format=count`
Then STDOUT should match /^\d+$/
@require-wp-5.5
Scenario: Getting a non-existent block pattern
When I try `wp pattern get nonexistent/pattern`
Then STDERR should contain:
"""
Error: Block pattern 'nonexistent/pattern' is not registered.
"""
And the return code should be 1
@require-wp-5.5
Scenario: Count block patterns
When I run `wp pattern list --format=count`
Then STDOUT should match /^\d+$/
@less-than-wp-5.0
Scenario: Pattern commands require WordPress 5.5+
When I try `wp pattern list`
Then STDERR should contain:
"""
Error: Requires WordPress 5.5 or greater.
"""
And the return code should be 1