Merge commit 'd435f549fe9bbfbea64ed9be36104e7a23f9603c' as 'libraries/action-scheduler'
This commit is contained in:
37
libraries/action-scheduler/tests/bootstrap.php
Normal file
37
libraries/action-scheduler/tests/bootstrap.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// phpcs:disable PEAR.Files.IncludingFile.UseRequireOnce
|
||||
|
||||
$GLOBALS['wp_tests_options']['template'] = 'twentyseventeen';
|
||||
$GLOBALS['wp_tests_options']['stylesheet'] = 'twentyseventeen';
|
||||
$GLOBALS['wp_tests_options']['active_plugins'][] = basename( dirname( __DIR__ ) ) . '/action-scheduler.php';
|
||||
|
||||
// Check for select constants defined as environment variables.
|
||||
foreach ( array( 'WP_CONTENT_DIR', 'WP_CONTENT_URL', 'WP_PLUGIN_DIR', 'WP_PLUGIN_URL', 'WPMU_PLUGIN_DIR' ) as $env_constant ) {
|
||||
if ( false !== getenv( $env_constant ) && ! defined( $env_constant ) ) {
|
||||
define( $env_constant, getenv( $env_constant ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
|
||||
define( 'WP_PLUGIN_DIR', dirname( dirname( dirname( __FILE__ ) ) ) );
|
||||
}
|
||||
|
||||
// PHPUnit polyfills as required by the core WP test framework.
|
||||
require_once __DIR__ . '/../vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php';
|
||||
|
||||
$wordpress_tests_dir = getenv( 'WP_TESTS_DIR' ) ? getenv( 'WP_TESTS_DIR' ) : sys_get_temp_dir() . '/wordpress-tests-lib';
|
||||
require_once $wordpress_tests_dir . '/includes/functions.php';
|
||||
require $wordpress_tests_dir . '/includes/bootstrap.php';
|
||||
|
||||
require_once dirname( dirname( __FILE__ ) ) . '/action-scheduler.php';
|
||||
|
||||
if ( class_exists( 'PHPUnit\Framework\TestResult' ) ) { // PHPUnit 6.0 or newer.
|
||||
include_once 'ActionScheduler_UnitTestCase.php';
|
||||
} else {
|
||||
include_once 'phpunit/deprecated/ActionScheduler_UnitTestCase.php';
|
||||
}
|
||||
|
||||
include_once 'phpunit/helpers/ActionScheduler_Callbacks.php';
|
||||
include_once 'phpunit/ActionScheduler_Mocker.php';
|
||||
include_once 'phpunit/ActionScheduler_Mock_Async_Request_QueueRunner.php';
|
||||
include_once 'phpunit/jobstore/AbstractStoreTest.php';
|
||||
Reference in New Issue
Block a user