From e1e505dc39b3341109173d490334019bd0b3dc11 Mon Sep 17 00:00:00 2001 From: gitlost Date: Wed, 5 Apr 2017 01:36:20 +0100 Subject: [PATCH 1/3] Special processing for WP_VERSION "latest" and "trunk". --- ci/behat-tags.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ci/behat-tags.php b/ci/behat-tags.php index df836b8309..a424e59e82 100644 --- a/ci/behat-tags.php +++ b/ci/behat-tags.php @@ -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 | uniq", $existing_tags ); + foreach ( $existing_tags as $tag ) { $compare = str_replace( "@{$prefix}-", '', $tag ); if ( version_compare( $current, $compare, $operator ) ) { From b9f15f905c09b14e41d2726dc8d8bfd5a87546f8 Mon Sep 17 00:00:00 2001 From: gitlost Date: Wed, 5 Apr 2017 07:11:21 +0100 Subject: [PATCH 2/3] In taxonomy test use nav_menu_item instead of link to by-pass WP 4.4 data change. --- features/taxonomy.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/taxonomy.feature b/features/taxonomy.feature index e2d75c3169..b1f6646fbf 100644 --- a/features/taxonomy.feature +++ b/features/taxonomy.feature @@ -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` From a8f4b2045447334a52e22b2a448263ee993103fc Mon Sep 17 00:00:00 2001 From: gitlost Date: Wed, 5 Apr 2017 08:13:02 +0100 Subject: [PATCH 3/3] Use "sort -u" to fully remove dups. --- ci/behat-tags.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/behat-tags.php b/ci/behat-tags.php index a424e59e82..fa1e60185d 100644 --- a/ci/behat-tags.php +++ b/ci/behat-tags.php @@ -32,7 +32,7 @@ function version_tags( $prefix, $current, $operator = '<' ) { } } - exec( "grep '@{$prefix}-[0-9\.]*' -h -o features/*.feature | uniq", $existing_tags ); + exec( "grep '@{$prefix}-[0-9\.]*' -h -o features/*.feature | sort -u", $existing_tags ); foreach ( $existing_tags as $tag ) { $compare = str_replace( "@{$prefix}-", '', $tag ); @@ -56,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();