-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbootstrap.php
55 lines (45 loc) · 1.32 KB
/
bootstrap.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Set up environment for my plugin's tests suite.
*/
/**
* The path to the WordPress tests checkout.
*/
define( 'WP_TESTS_DIR', '/home/berredo/Documents/repository/wordpress/wordpress-develop/tests/phpunit/' );
/**
* The WordPress tests functions.
*
* We are loading this so that we can add our tests filter
* to load the plugin, using tests_add_filter().
*/
require_once WP_TESTS_DIR . 'includes/functions.php';
/**
* Manually load the plugin main file.
*
* The plugin won't be activated within the test WP environment,
* that's why we need to load it manually.
*
* You will also need to perform any installation necessary after
* loading your plugin, since it won't be installed.
*/
function _manually_load_plugin() {
require 'src/class-nonce-generator.php';
require 'src/class-nonce-verifier.php';
require 'src/class-nonce-config.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
/**
* The WordPress tests functions.
*
* We are loading this so that we can add our tests filter
* to load the plugin, using tests_add_filter().
*/
require_once WP_TESTS_DIR . 'includes/functions.php';
/**
* Sets up the WordPress test environment.
*
* We've got our action set up, so we can load this now,
* and viola, the tests begin.
*/
require WP_TESTS_DIR . 'includes/bootstrap.php';
?>