Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions ci/behat-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@ function version_tags( $prefix, $current, $operator = '<' ) {
if ( ! $current )
return array();

exec( "grep '@{$prefix}-[0-9\.]*' -h -o features/*.feature | uniq", $existing_tags );

$skip_tags = array();

if ( 'require-wp' === $prefix ) {
if ( 'trunk' === $current ) {
// Exclude nothing.
return array();
}
// Exclude cutting-edge.
$skip_tags[] = '@require-wp-trunk';

if ( 'latest' === $current ) {
return $skip_tags;
}
}

exec( "grep '@{$prefix}-[0-9\.]*' -h -o features/*.feature | sort -u", $existing_tags );

foreach ( $existing_tags as $tag ) {
$compare = str_replace( "@{$prefix}-", '', $tag );
if ( version_compare( $current, $compare, $operator ) ) {
Expand All @@ -43,7 +56,7 @@ function version_tags( $prefix, $current, $operator = '<' ) {
# Require PHP extension, eg 'imagick'.
function extension_tags() {
$extension_tags = array();
exec( "grep '@require-extension-[A-Za-z_]*' -h -o features/*.feature | uniq", $extension_tags );
exec( "grep '@require-extension-[A-Za-z_]*' -h -o features/*.feature | sort -u", $extension_tags );

$skip_tags = array();

Expand Down
6 changes: 3 additions & 3 deletions features/taxonomy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Feature: Manage WordPress taxonomies
| category | Categories | | post | 1 | 1 | 1 |
| post_tag | Tags | | post | 1 | | 1 |

When I run `wp taxonomy list --object_type=link --format=csv`
When I run `wp taxonomy list --object_type=nav_menu_item --format=csv`
Then STDOUT should be CSV containing:
| name | label | description | object_type | show_tagcloud | hierarchical | public |
| link_category | Link Categories | | link | | | |
| name | label | description | object_type | show_tagcloud | hierarchical | public |
| nav_menu | Navigation Menus | | nav_menu_item | | | |

Scenario: Get taxonomy
When I try `wp taxonomy get invalid-taxonomy`
Expand Down