Completed
Pull Request — master (#81)
by Felix
03:53
created

bootstrap.php ➔ _manually_load_plugin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Bootstrap the plugin unit testing environment.
4
 *
5
 * @package WordPress
6
 * @subpackage Fields API
7
*/
8
define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
9
10
// Support for:
11
// 1. `WP_DEVELOP_DIR` environment variable
12
// 2. Plugin installed inside of WordPress.org developer checkout
13
// 3. Tests checked out to /tmp
14
// 4. VVV tests
15
if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
16
	$test_root = getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit';
17
} else if ( file_exists( '../../../../tests/phpunit/includes/bootstrap.php' ) ) {
18
	$test_root = '../../../../tests/phpunit';
19
} else if ( file_exists( '/tmp/wordpress-tests-lib/includes/bootstrap.php' ) ) {
20
	$test_root = '/tmp/wordpress-tests-lib';
21
} else if ( file_exists( '/srv/www/wordpress-develop/tests/phpunit/includes/bootstrap.php' ) ) {
22
	$test_root = '/srv/www/wordpress-develop/tests/phpunit';
23
}
24
25
require $test_root . '/includes/functions.php';
26
27
function _manually_load_plugin() {
28
	require dirname( __FILE__ ) . '/../wordpress-fields-api.php';
29
}
30
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
31
32
require $test_root . '/includes/bootstrap.php';
33