-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbootstrap.php
More file actions
51 lines (43 loc) · 1.46 KB
/
bootstrap.php
File metadata and controls
51 lines (43 loc) · 1.46 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
if ( ! defined( 'PROJECT' ) ) {
define( 'PROJECT', __DIR__ . '/../includes/' );
}
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __DIR__ ) . '/' );
}
if ( ! defined( 'WP_CONTENT_DIR' ) ) {
define( 'WP_CONTENT_DIR', sys_get_temp_dir() . '/powered-cache-wp-content' );
}
if ( ! defined( 'POWERED_CACHE_DIR' ) ) {
define( 'POWERED_CACHE_DIR', __DIR__ . '/' );
}
// Place any additional bootstrapping requirements here for PHP Unit.
if ( ! defined( 'WP_LANG_DIR' ) ) {
define( 'WP_LANG_DIR', 'lang_dir' );
}
if ( ! defined( 'POWERED_CACHE_PATH' ) ) {
define( 'POWERED_CACHE_PATH', 'path' );
}
if ( ! defined( 'POWERED_CACHE_URL' ) ) {
define( 'POWERED_CACHE_URL', 'https://example.test/wp-content/plugins/powered-cache/' );
}
if ( ! defined( 'POWERED_CACHE_VERSION' ) ) {
define( 'POWERED_CACHE_VERSION', 'test-version' );
}
if ( ! defined( 'POWERED_CACHE_DROPIN_DIR' ) ) {
define( 'POWERED_CACHE_DROPIN_DIR', dirname( __DIR__ ) . '/includes/dropins/' );
}
if ( ! defined( 'POWERED_CACHE_IS_NETWORK' ) ) {
define( 'POWERED_CACHE_IS_NETWORK', false );
}
if ( ! file_exists( __DIR__ . '/../vendor/autoload.php' ) ) {
throw new PHPUnit_Framework_Exception(
'ERROR' . PHP_EOL . PHP_EOL .
'You must use Composer to install the test suite\'s dependencies!' . PHP_EOL
);
}
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../tests/phpunit/test-tools/TestCase.php';
WP_Mock::setUsePatchwork( true );
WP_Mock::bootstrap();
WP_Mock::tearDown();