-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbootstrap.php
48 lines (39 loc) · 1.33 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
<?php
/**
* PHPUnit bootstrap file
*
* @package Bootswatch
*/
$bootswatch_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $bootswatch_tests_dir ) {
$bootswatch_tests_dir = '/tmp/wordpress-tests-lib';
}
// Give access to tests_add_filter() function.
require_once $bootswatch_tests_dir . '/includes/functions.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
/**
* Undocumented.
*/
function bootswatch_register_theme() {
$theme_dir = dirname( dirname( __FILE__ ) );
$current_theme = basename( $theme_dir );
register_theme_directory( dirname( $theme_dir ) );
add_filter(
'pre_option_template',
function() use ( $current_theme ) {
return $current_theme;
}
);
add_filter(
'pre_option_stylesheet',
function() use ( $current_theme ) {
return $current_theme;
}
);
}
tests_add_filter( 'muplugins_loaded', 'bootswatch_register_theme' );
// Start up the WP testing environment.
require $bootswatch_tests_dir . '/includes/bootstrap.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
// Load MonkeyTestCase class file.
require 'tests/class-monkey-test-case.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
// Load dependencies.
require 'vendor/autoload.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound