2013-08-07 08:38:38 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Installs WordPress for running the tests and loads WordPress and the test libraries
|
|
|
|
*/
|
|
|
|
|
2017-04-23 04:05:12 +02:00
|
|
|
/**
|
|
|
|
* Compatibility with PHPUnit 6+
|
|
|
|
*/
|
|
|
|
if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
|
2020-02-06 07:31:22 +01:00
|
|
|
require_once __DIR__ . '/phpunit6/compat.php';
|
2017-04-23 04:05:12 +02:00
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2018-06-16 16:21:18 +02:00
|
|
|
if ( defined( 'WP_TESTS_CONFIG_FILE_PATH' ) ) {
|
|
|
|
$config_file_path = WP_TESTS_CONFIG_FILE_PATH;
|
|
|
|
} else {
|
2020-02-06 07:31:22 +01:00
|
|
|
$config_file_path = dirname( __DIR__ );
|
2018-06-16 16:21:18 +02:00
|
|
|
if ( ! file_exists( $config_file_path . '/wp-tests-config.php' ) ) {
|
|
|
|
// Support the config file from the root of the develop repository.
|
|
|
|
if ( basename( $config_file_path ) === 'phpunit' && basename( dirname( $config_file_path ) ) === 'tests' ) {
|
|
|
|
$config_file_path = dirname( dirname( $config_file_path ) );
|
|
|
|
}
|
2017-12-01 00:09:33 +01:00
|
|
|
}
|
2018-06-16 16:21:18 +02:00
|
|
|
$config_file_path .= '/wp-tests-config.php';
|
2013-08-07 12:09:35 +02:00
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
|
|
|
|
/*
|
2019-09-20 23:58:42 +02:00
|
|
|
* Globalize some WordPress variables, because PHPUnit loads this file inside a function.
|
2013-08-07 08:38:38 +02:00
|
|
|
* See: https://github.com/sebastianbergmann/phpunit/issues/325
|
2013-08-29 20:39:34 +02:00
|
|
|
*/
|
2016-10-25 12:24:57 +02:00
|
|
|
global $wpdb, $current_site, $current_blog, $wp_rewrite, $shortcode_tags, $wp, $phpmailer, $wp_theme_directories;
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2017-02-17 00:29:16 +01:00
|
|
|
if ( ! is_readable( $config_file_path ) ) {
|
I18N: Remove the "Error:" prefix from error messages.
For a number of years, most of the WordPress error messages have been prefixed with "Error:". However, these messages appear in a context where it's already clear an error occurred. Whether it's an error, a warning, or any other classification, that's not so relevant for users. The content of the message is the relevant part. The "Error:" prefix doesn't add great value while it does add unnecessary complexity for the message readability.
Also, revises some of these messages to improve clarity and removes HTML from translatable strings.
Props garrett-eclipse, ramiy, SergeyBiryukov, afercia, sabernhardt, quadthemes, audrasjb.
See #47003, #43037, #42945, #15887.
Fixes #47656.
git-svn-id: https://develop.svn.wordpress.org/trunk@48059 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-16 17:33:37 +02:00
|
|
|
echo "wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.\n";
|
2017-02-17 00:29:16 +01:00
|
|
|
exit( 1 );
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
2019-03-27 00:52:03 +01:00
|
|
|
|
2013-08-07 08:38:38 +02:00
|
|
|
require_once $config_file_path;
|
2020-02-06 07:31:22 +01:00
|
|
|
require_once __DIR__ . '/functions.php';
|
2016-02-25 22:59:56 +01:00
|
|
|
|
2020-06-01 21:41:50 +02:00
|
|
|
if ( version_compare( tests_get_phpunit_version(), '5.4', '<' ) || version_compare( tests_get_phpunit_version(), '8.0', '>=' ) ) {
|
2019-02-03 23:40:56 +01:00
|
|
|
printf(
|
I18N: Remove the "Error:" prefix from error messages.
For a number of years, most of the WordPress error messages have been prefixed with "Error:". However, these messages appear in a context where it's already clear an error occurred. Whether it's an error, a warning, or any other classification, that's not so relevant for users. The content of the message is the relevant part. The "Error:" prefix doesn't add great value while it does add unnecessary complexity for the message readability.
Also, revises some of these messages to improve clarity and removes HTML from translatable strings.
Props garrett-eclipse, ramiy, SergeyBiryukov, afercia, sabernhardt, quadthemes, audrasjb.
See #47003, #43037, #42945, #15887.
Fixes #47656.
git-svn-id: https://develop.svn.wordpress.org/trunk@48059 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-16 17:33:37 +02:00
|
|
|
"Looks like you're using PHPUnit %s. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x.\n",
|
2019-02-03 23:40:56 +01:00
|
|
|
tests_get_phpunit_version()
|
|
|
|
);
|
|
|
|
echo "Please use the latest PHPUnit version from the 7.x branch.\n";
|
|
|
|
exit( 1 );
|
|
|
|
}
|
|
|
|
|
2019-03-27 00:52:03 +01:00
|
|
|
if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! is_dir( ABSPATH ) ) {
|
I18N: Remove the "Error:" prefix from error messages.
For a number of years, most of the WordPress error messages have been prefixed with "Error:". However, these messages appear in a context where it's already clear an error occurred. Whether it's an error, a warning, or any other classification, that's not so relevant for users. The content of the message is the relevant part. The "Error:" prefix doesn't add great value while it does add unnecessary complexity for the message readability.
Also, revises some of these messages to improve clarity and removes HTML from translatable strings.
Props garrett-eclipse, ramiy, SergeyBiryukov, afercia, sabernhardt, quadthemes, audrasjb.
See #47003, #43037, #42945, #15887.
Fixes #47656.
git-svn-id: https://develop.svn.wordpress.org/trunk@48059 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-16 17:33:37 +02:00
|
|
|
echo "The /build/ directory is missing! Please run `npm run build` prior to running PHPUnit.\n";
|
2019-03-27 00:52:03 +01:00
|
|
|
exit( 1 );
|
|
|
|
}
|
|
|
|
|
2016-02-26 03:08:47 +01:00
|
|
|
tests_reset__SERVER();
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2014-07-01 20:51:46 +02:00
|
|
|
define( 'WP_TESTS_TABLE_PREFIX', $table_prefix );
|
2020-02-06 07:31:22 +01:00
|
|
|
define( 'DIR_TESTDATA', __DIR__ . '/../data' );
|
|
|
|
define( 'DIR_TESTROOT', realpath( dirname( __DIR__ ) ) );
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2016-02-17 23:01:11 +01:00
|
|
|
define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' );
|
|
|
|
|
2017-12-01 00:09:33 +01:00
|
|
|
if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) {
|
2013-08-07 08:38:38 +02:00
|
|
|
define( 'WP_TESTS_FORCE_KNOWN_BUGS', false );
|
2017-12-01 00:09:33 +01:00
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2019-09-20 23:58:42 +02:00
|
|
|
/*
|
|
|
|
* Cron tries to make an HTTP request to the site, which always fails,
|
|
|
|
* because tests are run in CLI mode only.
|
|
|
|
*/
|
2013-08-07 08:38:38 +02:00
|
|
|
define( 'DISABLE_WP_CRON', true );
|
|
|
|
|
|
|
|
define( 'WP_MEMORY_LIMIT', -1 );
|
|
|
|
define( 'WP_MAX_MEMORY_LIMIT', -1 );
|
|
|
|
|
REST API: Introduce the Content API endpoints.
REST API endpoints for your WordPress content. These endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, allowing new and innovative apps for interacting with your site. These endpoints support all of the following:
- Posts: Read and write access to all post data, for all types of post-based data, including pages and media.
- Comments: Read and write access to all comment data. This includes pingbacks and trackbacks.
- Terms: Read and write access to all term data.
- Users: Read and write access to all user data. This includes public access to some data for post authors.
- Meta: Read and write access to metadata for posts, comments, terms, and users, on an opt-in basis from plugins.
- Settings: Read and write access to settings, on an opt-in basis from plugins and core. This enables API management of key site content values that are technically stored in options, such as site title and byline.
Love your REST API, WordPress! The infrastructure says, "Let's do lunch!" but the content API endpoints say, "You're paying!"
Props rmccue, rachelbaker, danielbachhuber, joehoyle, adamsilverstein, afurculita, ahmadawais, airesvsg, alisspers, antisilent, apokalyptik, artoliukkonen, attitude, boonebgorges, bradyvercher, brianhogg, caseypatrickdriscoll, chopinbach, chredd, christianesperar, chrisvanpatten, claudiolabarbera, claudiosmweb, cmmarslender, codebykat, coderkevin, codfish, codonnell822, daggerhart, danielpunkass, davidbhayes, delphinus, desrosj, dimadin, dotancohen, DrewAPicture, Dudo1985, duncanjbrown, eherman24, eivhyl, eliorivero, elyobo, en-alis, ericandrewlewis, ericpedia, evansobkowicz, fjarrett, frozzare, georgestephanis, greatislander, guavaworks, hideokamoto, hkdobrev, hubdotcom, hurtige, iandunn, ircrash, ironpaperweight, iseulde, Japh, jaredcobb, JDGrimes, jdolan, jdoubleu, jeremyfelt, jimt, jjeaton, jmusal, jnylen0, johanmynhardt, johnbillion, jonathanbardo, jorbin, joshkadis, JPry, jshreve, jtsternberg, JustinSainton, kacperszurek, kadamwhite, kalenjohnson, kellbot, kjbenk, kokarn, krogsgard, kuchenundkakao, kuldipem, kwight, lgedeon, lukepettway, mantismamita, markoheijnen, matrixik, mattheu, mauteri, maxcutler, mayukojpn, michael-arestad, miyauchi, mjbanks, modemlooper, mrbobbybryant, NateWr, nathanrice, netweb, NikV, nullvariable, oskosk, oso96_2000, oxymoron, pcfreak30, pento, peterwilsoncc, Pezzab, phh, pippinsplugins, pjgalbraith, pkevan, pollyplummer, pushred, quasel, QWp6t, schlessera, schrapel, Shelob9, shprink, simonlampen, Soean, solal, tapsboy, tfrommen, tharsheblows, thenbrent, tierra, tlovett1, tnegri, tobych, Toddses, toro_unit, traversal, vanillalounge, vishalkakadiya, wanecek, web2style, webbgaraget, websupporter, westonruter, whyisjake, wonderboymusic, wpsmith, xknown, zyphonic.
Fixes #38373.
git-svn-id: https://develop.svn.wordpress.org/trunk@38832 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-20 04:54:12 +02:00
|
|
|
define( 'REST_TESTS_IMPOSSIBLY_HIGH_NUMBER', 99999999 );
|
|
|
|
|
2019-07-02 06:43:01 +02:00
|
|
|
$PHP_SELF = '/index.php';
|
|
|
|
$GLOBALS['PHP_SELF'] = '/index.php';
|
|
|
|
$_SERVER['PHP_SELF'] = '/index.php';
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2016-04-20 18:51:58 +02:00
|
|
|
// Should we run in multisite mode?
|
2019-07-08 02:55:20 +02:00
|
|
|
$multisite = ( '1' === getenv( 'WP_MULTISITE' ) );
|
2017-12-01 00:09:33 +01:00
|
|
|
$multisite = $multisite || ( defined( 'WP_TESTS_MULTISITE' ) && WP_TESTS_MULTISITE );
|
2016-04-20 18:51:58 +02:00
|
|
|
$multisite = $multisite || ( defined( 'MULTISITE' ) && MULTISITE );
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2020-01-29 01:43:23 +01:00
|
|
|
// Override the PHPMailer.
|
2020-02-06 07:31:22 +01:00
|
|
|
require_once __DIR__ . '/mock-mailer.php';
|
2016-11-02 05:26:18 +01:00
|
|
|
$phpmailer = new MockPHPMailer( true );
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2016-10-25 12:24:57 +02:00
|
|
|
if ( ! defined( 'WP_DEFAULT_THEME' ) ) {
|
|
|
|
define( 'WP_DEFAULT_THEME', 'default' );
|
|
|
|
}
|
2018-05-26 00:42:11 +02:00
|
|
|
$wp_theme_directories = array();
|
|
|
|
|
|
|
|
if ( file_exists( DIR_TESTDATA . '/themedir1' ) ) {
|
|
|
|
$wp_theme_directories[] = DIR_TESTDATA . '/themedir1';
|
|
|
|
}
|
2016-10-21 13:02:37 +02:00
|
|
|
|
2019-01-10 03:18:19 +01:00
|
|
|
if ( '1' !== getenv( 'WP_TESTS_SKIP_INSTALL' ) ) {
|
2020-03-24 01:18:29 +01:00
|
|
|
$core_tests = ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) ? 'run_core_tests' : 'no_core_tests';
|
|
|
|
$ms_tests = $multisite ? 'run_ms_tests' : 'no_ms_tests';
|
|
|
|
|
|
|
|
system( WP_PHP_BINARY . ' ' . escapeshellarg( __DIR__ . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $ms_tests . ' ' . $core_tests, $retval );
|
2019-01-10 03:18:19 +01:00
|
|
|
if ( 0 !== $retval ) {
|
|
|
|
exit( $retval );
|
|
|
|
}
|
2017-10-21 16:13:37 +02:00
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
|
|
|
|
if ( $multisite ) {
|
2017-12-01 00:09:33 +01:00
|
|
|
echo 'Running as multisite...' . PHP_EOL;
|
2016-04-20 18:51:58 +02:00
|
|
|
defined( 'MULTISITE' ) or define( 'MULTISITE', true );
|
|
|
|
defined( 'SUBDOMAIN_INSTALL' ) or define( 'SUBDOMAIN_INSTALL', false );
|
2013-08-07 08:38:38 +02:00
|
|
|
$GLOBALS['base'] = '/';
|
|
|
|
} else {
|
2017-12-01 00:09:33 +01:00
|
|
|
echo 'Running as single site... To run multisite, use -c tests/phpunit/multisite.xml' . PHP_EOL;
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
|
|
|
unset( $multisite );
|
|
|
|
|
2014-06-21 21:59:28 +02:00
|
|
|
$GLOBALS['_wp_die_disabled'] = false;
|
2020-01-29 01:43:23 +01:00
|
|
|
// Allow tests to override wp_die().
|
2014-06-21 21:59:28 +02:00
|
|
|
tests_add_filter( 'wp_die_handler', '_wp_die_handler_filter' );
|
2020-01-29 01:43:23 +01:00
|
|
|
// Use the Spy REST Server instead of default.
|
2018-02-21 17:24:30 +01:00
|
|
|
tests_add_filter( 'wp_rest_server_class', '_wp_rest_server_class_filter' );
|
2014-06-21 21:59:28 +02:00
|
|
|
|
2013-08-07 08:38:38 +02:00
|
|
|
// Preset WordPress options defined in bootstrap file.
|
2020-01-29 01:43:23 +01:00
|
|
|
// Used to activate themes, plugins, as well as other settings.
|
2017-12-01 00:09:33 +01:00
|
|
|
if ( isset( $GLOBALS['wp_tests_options'] ) ) {
|
2013-08-07 08:38:38 +02:00
|
|
|
function wp_tests_options( $value ) {
|
|
|
|
$key = substr( current_filter(), strlen( 'pre_option_' ) );
|
2017-12-01 00:09:33 +01:00
|
|
|
return $GLOBALS['wp_tests_options'][ $key ];
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach ( array_keys( $GLOBALS['wp_tests_options'] ) as $key ) {
|
2017-12-01 00:09:33 +01:00
|
|
|
tests_add_filter( 'pre_option_' . $key, 'wp_tests_options' );
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-29 01:43:23 +01:00
|
|
|
// Load WordPress.
|
2013-08-07 08:38:38 +02:00
|
|
|
require_once ABSPATH . '/wp-settings.php';
|
|
|
|
|
2020-01-29 01:43:23 +01:00
|
|
|
// Delete any default posts & related data.
|
2013-08-07 08:38:38 +02:00
|
|
|
_delete_all_posts();
|
|
|
|
|
2019-01-28 15:10:24 +01:00
|
|
|
if ( version_compare( tests_get_phpunit_version(), '7.0', '>=' ) ) {
|
2020-02-06 07:31:22 +01:00
|
|
|
require __DIR__ . '/phpunit7/testcase.php';
|
2019-01-28 15:10:24 +01:00
|
|
|
} else {
|
2020-02-06 07:31:22 +01:00
|
|
|
require __DIR__ . '/testcase.php';
|
2019-01-28 15:10:24 +01:00
|
|
|
}
|
|
|
|
|
2020-02-06 07:31:22 +01:00
|
|
|
require __DIR__ . '/testcase-rest-api.php';
|
|
|
|
require __DIR__ . '/testcase-rest-controller.php';
|
|
|
|
require __DIR__ . '/testcase-rest-post-type-controller.php';
|
|
|
|
require __DIR__ . '/testcase-xmlrpc.php';
|
|
|
|
require __DIR__ . '/testcase-ajax.php';
|
|
|
|
require __DIR__ . '/testcase-canonical.php';
|
Sitemaps: Add XML sitemaps functionality to WordPress.
While web crawlers are able to discover pages from links within the site and from other sites, XML sitemaps supplement this approach by allowing crawlers to quickly and comprehensively identify all URLs included in the sitemap and learn other signals about those URLs using the associated metadata.
See https://make.wordpress.org/core/2020/06/10/merge-announcement-extensible-core-sitemaps/ for more details.
This feature exposes the sitemap index via `/wp-sitemap.xml` and exposes a variety of new filters and hooks for developers to modify the behavior. Users can disable sitemaps completely by turning off search engine visibility in WordPress admin.
This change also introduces a new `esc_xml()` function to escape strings for output in XML, as well as XML support to `wp_kses_normalize_entities()`.
Props Adrian McShane, afragen, adamsilverstein, casiepa, flixos90, garrett-eclipse, joemcgill, kburgoine, kraftbj, milana_cap, pacifika, pbiron, pfefferle, Ruxandra Gradina, swissspidy, szepeviktor, tangrufus, tweetythierry.
Fixes #50117.
See #3670. See #19998.
git-svn-id: https://develop.svn.wordpress.org/trunk@48072 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-17 17:22:49 +02:00
|
|
|
require __DIR__ . '/testcase-xml.php';
|
2020-02-06 07:31:22 +01:00
|
|
|
require __DIR__ . '/exceptions.php';
|
|
|
|
require __DIR__ . '/utils.php';
|
|
|
|
require __DIR__ . '/spy-rest-server.php';
|
|
|
|
require __DIR__ . '/class-wp-rest-test-search-handler.php';
|
2020-02-20 17:56:17 +01:00
|
|
|
require __DIR__ . '/class-wp-rest-test-configurable-controller.php';
|
2020-02-06 07:31:22 +01:00
|
|
|
require __DIR__ . '/class-wp-fake-block-type.php';
|
Sitemaps: Add XML sitemaps functionality to WordPress.
While web crawlers are able to discover pages from links within the site and from other sites, XML sitemaps supplement this approach by allowing crawlers to quickly and comprehensively identify all URLs included in the sitemap and learn other signals about those URLs using the associated metadata.
See https://make.wordpress.org/core/2020/06/10/merge-announcement-extensible-core-sitemaps/ for more details.
This feature exposes the sitemap index via `/wp-sitemap.xml` and exposes a variety of new filters and hooks for developers to modify the behavior. Users can disable sitemaps completely by turning off search engine visibility in WordPress admin.
This change also introduces a new `esc_xml()` function to escape strings for output in XML, as well as XML support to `wp_kses_normalize_entities()`.
Props Adrian McShane, afragen, adamsilverstein, casiepa, flixos90, garrett-eclipse, joemcgill, kburgoine, kraftbj, milana_cap, pacifika, pbiron, pfefferle, Ruxandra Gradina, swissspidy, szepeviktor, tangrufus, tweetythierry.
Fixes #50117.
See #3670. See #19998.
git-svn-id: https://develop.svn.wordpress.org/trunk@48072 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-17 17:22:49 +02:00
|
|
|
require __DIR__ . '/class-wp-sitemaps-test-provider.php';
|
|
|
|
require __DIR__ . '/class-wp-sitemaps-empty-test-provider.php';
|
2013-08-07 08:38:38 +02:00
|
|
|
|
|
|
|
/**
|
2019-01-30 01:53:52 +01:00
|
|
|
* A class to handle additional command line arguments passed to the script.
|
2013-08-07 08:38:38 +02:00
|
|
|
*
|
|
|
|
* If it is determined that phpunit was called with a --group that corresponds
|
|
|
|
* to an @ticket annotation (such as `phpunit --group 12345` for bugs marked
|
|
|
|
* as #WP12345), then it is assumed that known bugs should not be skipped.
|
|
|
|
*
|
|
|
|
* If WP_TESTS_FORCE_KNOWN_BUGS is already set in wp-tests-config.php, then
|
|
|
|
* how you call phpunit has no effect.
|
|
|
|
*/
|
2019-01-28 15:10:24 +01:00
|
|
|
class WP_PHPUnit_Util_Getopt {
|
2013-12-27 16:07:07 +01:00
|
|
|
|
2019-01-30 01:53:52 +01:00
|
|
|
function __construct( $argv ) {
|
2014-11-10 15:48:28 +01:00
|
|
|
$skipped_groups = array(
|
2017-12-01 00:09:33 +01:00
|
|
|
'ajax' => true,
|
|
|
|
'ms-files' => true,
|
2014-11-10 15:48:28 +01:00
|
|
|
'external-http' => true,
|
|
|
|
);
|
|
|
|
|
2019-01-30 01:53:52 +01:00
|
|
|
while ( current( $argv ) ) {
|
|
|
|
$option = current( $argv );
|
|
|
|
$value = next( $argv );
|
|
|
|
|
|
|
|
switch ( $option ) {
|
2017-12-01 00:09:33 +01:00
|
|
|
case '--exclude-group':
|
2014-11-10 15:48:28 +01:00
|
|
|
foreach ( $skipped_groups as $group_name => $skipped ) {
|
|
|
|
$skipped_groups[ $group_name ] = false;
|
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
continue 2;
|
2017-12-01 00:09:33 +01:00
|
|
|
case '--group':
|
2019-01-30 01:53:52 +01:00
|
|
|
$groups = explode( ',', $value );
|
2013-08-07 08:38:38 +02:00
|
|
|
foreach ( $groups as $group ) {
|
2013-12-27 16:07:07 +01:00
|
|
|
if ( is_numeric( $group ) || preg_match( '/^(UT|Plugin)\d+$/', $group ) ) {
|
2013-08-07 08:38:38 +02:00
|
|
|
WP_UnitTestCase::forceTicket( $group );
|
2013-12-27 16:07:07 +01:00
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
2014-11-10 15:48:28 +01:00
|
|
|
|
|
|
|
foreach ( $skipped_groups as $group_name => $skipped ) {
|
2019-07-08 02:55:20 +02:00
|
|
|
if ( in_array( $group_name, $groups, true ) ) {
|
2014-11-10 15:48:28 +01:00
|
|
|
$skipped_groups[ $group_name ] = false;
|
|
|
|
}
|
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
continue 2;
|
|
|
|
}
|
|
|
|
}
|
2014-11-10 15:48:28 +01:00
|
|
|
|
|
|
|
$skipped_groups = array_filter( $skipped_groups );
|
|
|
|
foreach ( $skipped_groups as $group_name => $skipped ) {
|
|
|
|
echo sprintf( 'Not running %1$s tests. To execute these, use --group %1$s.', $group_name ) . PHP_EOL;
|
2014-11-08 22:07:05 +01:00
|
|
|
}
|
2015-10-06 05:36:18 +02:00
|
|
|
|
2015-10-06 19:27:12 +02:00
|
|
|
if ( ! isset( $skipped_groups['external-http'] ) ) {
|
2015-10-06 05:36:18 +02:00
|
|
|
echo PHP_EOL;
|
|
|
|
echo 'External HTTP skipped tests can be caused by timeouts.' . PHP_EOL;
|
2015-10-06 19:27:12 +02:00
|
|
|
echo 'If this changeset includes changes to HTTP, make sure there are no timeouts.' . PHP_EOL;
|
2015-10-06 05:36:18 +02:00
|
|
|
echo PHP_EOL;
|
|
|
|
}
|
2017-12-01 00:09:33 +01:00
|
|
|
}
|
2019-01-28 15:10:24 +01:00
|
|
|
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
2013-12-27 16:07:07 +01:00
|
|
|
new WP_PHPUnit_Util_Getopt( $_SERVER['argv'] );
|