Skip to content

Commit d89f048

Browse files
buntybuddybossschlessera
authored andcommitted
Add functional test for strict/no-strict mode for taxonomy
1 parent 6412056 commit d89f048

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

features/taxonomy.feature

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,42 @@ Feature: Manage WordPress taxonomies
4646
| Field | Value |
4747
| name | category |
4848
| count | 1 |
49+
50+
Scenario: Listing taxonomies with strict/no-strict mode
51+
Given a WP installation
52+
And a wp-content/mu-plugins/test-taxonomy-list.php file:
53+
"""
54+
<?php
55+
// Plugin Name: Test Taxonomy Strict/No-Strict Mode
56+
57+
add_action( 'init', function(){
58+
$args = array(
59+
'hierarchical' => true,
60+
'show_ui' => true,
61+
'show_admin_column' => true,
62+
'update_count_callback' => '_update_post_term_count',
63+
'query_var' => true,
64+
'labels' => array(
65+
'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
66+
),
67+
68+
);
69+
70+
register_taxonomy( 'genres', array( 'post','page' ), $args );
71+
});
72+
"""
73+
74+
When I run `wp taxonomy list --object_type=post --strict`
75+
Then STDOUT should be a table containing rows:
76+
| name | label | description | object_type | show_tagcloud | hierarchical | public |
77+
| category | Categories | | post | 1 | 1 | 1 |
78+
| post_tag | Tags | | post | 1 | | 1 |
79+
| post_format | Formats | | post | | | 1 |
80+
81+
When I run `wp taxonomy list --object_type=post --no-strict`
82+
Then STDOUT should be a table containing rows:
83+
| name | label | description | object_type | show_tagcloud | hierarchical | public |
84+
| category | Categories | | post | 1 | 1 | 1 |
85+
| post_tag | Tags | | post | 1 | | 1 |
86+
| post_format | Formats | | post | | | 1 |
87+
| genres | Genres | | post, page | 1 | 1 | 1 |

0 commit comments

Comments
 (0)