@@ -46,3 +46,83 @@ Feature: Manage WordPress taxonomies
4646 | Field | Value |
4747 | name | category |
4848 | count | 1 |
49+
50+ @require-wp-5.1
51+ Scenario : Listing taxonomies with strict/no-strict mode
52+ Given a WP installation
53+ And a wp-content/mu-plugins/test-taxonomy-list.php file:
54+ """
55+ <?php
56+ // Plugin Name: Test Taxonomy Strict/No-Strict Mode
57+
58+ add_action( 'init', function() {
59+ $args = array(
60+ 'hierarchical' => true,
61+ 'show_ui' => true,
62+ 'show_admin_column' => true,
63+ 'update_count_callback' => '_update_post_term_count',
64+ 'query_var' => true,
65+ 'labels' => array(
66+ 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
67+ ),
68+
69+ );
70+
71+ register_taxonomy( 'genres', array( 'post','page' ), $args );
72+ } );
73+ """
74+
75+ When I run `wp taxonomy list --object_type=post --strict`
76+ Then STDOUT should be a table containing rows:
77+ | name | label | description | object_type | show_tagcloud | hierarchical | public |
78+ | category | Categories | | post | 1 | 1 | 1 |
79+ | post_tag | Tags | | post | 1 | | 1 |
80+ | post_format | Formats | | post | | | 1 |
81+
82+ When I run `wp taxonomy list --object_type=post --no-strict`
83+ Then STDOUT should be a table containing rows:
84+ | name | label | description | object_type | show_tagcloud | hierarchical | public |
85+ | category | Categories | | post | 1 | 1 | 1 |
86+ | post_tag | Tags | | post | 1 | | 1 |
87+ | post_format | Formats | | post | | | 1 |
88+ | genres | Genres | | post , page | 1 | 1 | 1 |
89+
90+ @less-than-wp-5.1
91+ Scenario : Listing taxonomies with strict/no-strict mode (for WP < 5.1)
92+ Given a WP installation
93+ And a wp-content/mu-plugins/test-taxonomy-list.php file:
94+ """
95+ <?php
96+ // Plugin Name: Test Taxonomy Strict/No-Strict Mode
97+
98+ add_action( 'init', function() {
99+ $args = array(
100+ 'hierarchical' => true,
101+ 'show_ui' => true,
102+ 'show_admin_column' => true,
103+ 'update_count_callback' => '_update_post_term_count',
104+ 'query_var' => true,
105+ 'labels' => array(
106+ 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
107+ ),
108+
109+ );
110+
111+ register_taxonomy( 'genres', array( 'post','page' ), $args );
112+ } );
113+ """
114+
115+ When I run `wp taxonomy list --object_type=post --strict`
116+ Then STDOUT should be a table containing rows:
117+ | name | label | description | object_type | show_tagcloud | hierarchical | public |
118+ | category | Categories | | post | 1 | 1 | 1 |
119+ | post_tag | Tags | | post | 1 | | 1 |
120+ | post_format | Format | | post | | | 1 |
121+
122+ When I run `wp taxonomy list --object_type=post --no-strict`
123+ Then STDOUT should be a table containing rows:
124+ | name | label | description | object_type | show_tagcloud | hierarchical | public |
125+ | category | Categories | | post | 1 | 1 | 1 |
126+ | post_tag | Tags | | post | 1 | | 1 |
127+ | post_format | Format | | post | | | 1 |
128+ | genres | Genres | | post , page | 1 | 1 | 1 |
0 commit comments