-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathpost-type.feature
More file actions
49 lines (43 loc) · 1.46 KB
/
post-type.feature
File metadata and controls
49 lines (43 loc) · 1.46 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
Feature: Manage WordPress post types
Background:
Given a WP install
Scenario: Listing post types
When I run `wp post-type list --format=csv`
Then STDOUT should be CSV containing:
| name | label | description | hierarchical | public | capability_type |
| post | Posts | | false | true | post |
| page | Pages | | true | true | page |
@require-wp-5.0
Scenario: Listing post types with count
When I run `wp post-type list --fields=name,count --format=csv`
Then STDOUT should be CSV containing:
| name | count |
| post | 1 |
| page | 2 |
Scenario: Get a post type
When I try `wp post-type get invalid-post-type`
Then STDERR should be:
"""
Error: Post type invalid-post-type doesn't exist.
"""
And the return code should be 1
When I run `wp post-type get page`
Then STDOUT should be a table containing rows:
| Field | Value |
| name | page |
| label | Pages |
And STDOUT should contain:
"""
supports
"""
And STDOUT should contain:
"""
"title":true
"""
@require-wp-5.0
Scenario: Get a post type with count
When I try `wp post-type get page --fields=name,count`
Then STDOUT should be a table containing rows:
| Field | Value |
| name | page |
| count | 2 |