-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwp-tests-config.php
39 lines (29 loc) · 1.19 KB
/
wp-tests-config.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
<?php
/**
* WP config file used during the unit tests.
* Note that wp-env replaces this with its own config file.
*
* phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
*/
// Include the project-wide autoloader.
require_once __DIR__ . '/vendor/autoload.php';
define( 'ABSPATH', __DIR__ . '/wp/' );
define( 'WP_DEBUG', true );
define( 'DB_NAME', getenv( 'WP_DB_NAME' ) ? getenv( 'WP_DB_NAME' ) : 'wp_phpunit_tests' );
define( 'DB_USER', getenv( 'WP_DB_USER' ) ? getenv( 'WP_DB_USER' ) : 'root' );
define( 'DB_PASSWORD', getenv( 'WP_DB_PASSWORD' ) ? getenv( 'WP_DB_PASSWORD' ) : '' );
define( 'DB_HOST', getenv( 'WP_DB_HOST' ) ? getenv( 'WP_DB_HOST' ) : 'localhost' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
$table_prefix = 'wpphpunittests_';
define( 'WP_TESTS_DOMAIN', 'example.org' );
define( 'WP_TESTS_EMAIL', '[email protected]' );
define( 'WP_TESTS_TITLE', 'Test Blog' );
define( 'WP_PHP_BINARY', 'php' );
define( 'WPLANG', '' );
$db_connection = new XWP\Wait_For\Tcp_Connection( DB_HOST, 3306 );
try {
$db_connection->connect( 30 ); // Wait 30 seconds for the DB to become available.
} catch ( Exception $e ) {
trigger_error( $e->getMessage(), E_USER_ERROR );
}