Passed
Push — master ( 52790a...edfd70 )
by Lucien
01:31
created

_manually_load_plugin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 2
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
require_once __DIR__ . '/../vendor/autoload.php';
4
5
$_tests_dir = getenv('WP_TESTS_DIR');
6
if ($_tests_dir === false) {
7
  $_tests_dir = '/tmp/wordpress-tests-lib';
8
}
9
10
define('PLUGIN_FILE', getenv('PLUGIN_FILE'));
11
define('PLUGIN_FOLDER', basename(dirname(__DIR__)));
12
define('PLUGIN_PATH', PLUGIN_FOLDER . '/' . PLUGIN_FILE);
13
14
$GLOBALS['wp_tests_options'] = [
15
  'active_plugins' => [PLUGIN_PATH],
16
  'template'       => 'twentysixteen',
17
  'stylesheet'     => 'twentysixteen',
18
];
19
20
require_once $_tests_dir . '/includes/functions.php';
21
22
tests_add_filter(
23
  'muplugins_loaded',
24
  function () {
25
    // Manually load plugin
26
    include __DIR__ . '/../WPTools.php';
27
  }
28
);
29
30
tests_add_filter('shutdown', 'drop_tables', 999999);
31
32
require $_tests_dir . '/includes/bootstrap.php';
33