forked from sc0ttkclark/wordpress-fields-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
executable file
·32 lines (28 loc) · 1.08 KB
/
bootstrap.php
File metadata and controls
executable file
·32 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* Bootstrap the plugin unit testing environment.
*
* @package WordPress
* @subpackage Fields API
*/
define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
// Support for:
// 1. `WP_DEVELOP_DIR` environment variable
// 2. Plugin installed inside of WordPress.org developer checkout
// 3. Tests checked out to /tmp
// 4. VVV tests
if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
$test_root = getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit';
} else if ( file_exists( '../../../../tests/phpunit/includes/bootstrap.php' ) ) {
$test_root = '../../../../tests/phpunit';
} else if ( file_exists( '/tmp/wordpress-tests-lib/includes/bootstrap.php' ) ) {
$test_root = '/tmp/wordpress-tests-lib';
} else if ( file_exists( '/srv/www/wordpress-develop/tests/phpunit/includes/bootstrap.php' ) ) {
$test_root = '/srv/www/wordpress-develop/tests/phpunit';
}
require $test_root . '/includes/functions.php';
function _manually_load_plugin() {
require dirname( __FILE__ ) . '/../wordpress-fields-api.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
require $test_root . '/includes/bootstrap.php';