* Require a minimum version of WordPress: * * @require-wp-4.0 * Scenario: Core translation CRUD * * Then use in bash script: * * BEHAT_TAGS=$(php behat-tags.php) * vendor/bin/behat --format progress $BEHAT_TAGS */ function version_tags($prefix, $current, $operator = '<') { if (!$current) { return; } exec("grep '@{$prefix}-[0-9\\.]*' -h -o features/*.feature | uniq", $existing_tags); $skip_tags = array(); foreach ($existing_tags as $tag) { $compare = str_replace("@{$prefix}-", '', $tag); if (version_compare($current, $compare, $operator)) { $skip_tags[] = $tag; } } return $skip_tags; } $skip_tags = array_merge(version_tags('require-wp', getenv('WP_VERSION'), '<'), version_tags('require-php', PHP_VERSION, '<'), version_tags('less-than-php', PHP_VERSION, '>')); # Skip Github API tests by default because of rate limiting. See https://github.com/wp-cli/wp-cli/issues/1612 $skip_tags[] = '@github-api'; if (!empty($skip_tags)) { echo '--tags=~' . implode('&&~', $skip_tags); }
$packagelist = array(); foreach(array("bindist", "stable", "unstable") as $rel_type) { $pack = fetch_package($pobj['name'], null, $dist->getName(), $rel_type, $dist->getArchitecture(), $showall); array_push($packagelist, $pack); } memcache_set_key($pkey, $packagelist); } foreach ($packagelist as $pack) { if ($pack == null) { avail_td(" "); continue; } if (is_array($pack) && !isset($pack['doc_id'])) { $pack = array_pop($pack); } list($open_tag, $close_tag) = version_tags($pack); $pkginfo = $open_tag . get_full_version($pack) . $close_tag; if ($rel_type == "bindist") { $pkginfo .= ' (bindist ' . $pack['rel_version'] . ')'; } avail_td($pkginfo); } $last_dist_id = $dist_id; } print "</table>\n"; print "<br>"; it_start();
<?php function php_version_tags() { exec('grep "@require-php-[0-9\\.]*" -h -o features/*.feature | uniq', $existing_tags); } function version_tags($prefix, $current) { if (!$current) { return; } exec("grep '@{$prefix}-[0-9\\.]*' -h -o features/*.feature | uniq", $existing_tags); $skip_tags = array(); foreach ($existing_tags as $tag) { $required = str_replace("@{$prefix}-", '', $tag); if (version_compare($current, $required, '<')) { $skip_tags[] = $tag; } } return $skip_tags; } $skip_tags = array_merge(version_tags('require-wp', getenv('WP_VERSION')), version_tags('require-php', PHP_VERSION)); # Skip Github API tests by default because of rate limiting. See https://github.com/wp-cli/wp-cli/issues/1612 $skip_tags[] = '@github-api'; if (!empty($skip_tags)) { echo '--tags=~' . implode('&&~', $skip_tags); }