Skip to content

Commit ffedeea

Browse files
committed
Adapt test for string change in WP 5.1
1 parent 1087419 commit ffedeea

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

features/taxonomy.feature

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Feature: Manage WordPress taxonomies
4747
| name | category |
4848
| count | 1 |
4949

50+
@require-wp-5.1
5051
Scenario: Listing taxonomies with strict/no-strict mode
5152
Given a WP installation
5253
And a wp-content/mu-plugins/test-taxonomy-list.php file:
@@ -85,3 +86,43 @@ Feature: Manage WordPress taxonomies
8586
| post_tag | Tags | | post | 1 | | 1 |
8687
| post_format | Formats | | post | | | 1 |
8788
| 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

Comments
 (0)