Skip to content

Instantly share code, notes, and snippets.

@davidperezgar
Created August 15, 2025 09:35
Show Gist options
  • Save davidperezgar/4908a8095a7b1f8e971353c967c4be06 to your computer and use it in GitHub Desktop.
Save davidperezgar/4908a8095a7b1f8e971353c967c4be06 to your computer and use it in GitHub Desktop.
Add Bootstrap at the beginning for tests
define( 'TESTS_PLUGIN_DIR', dirname( __DIR__ ) );
define( 'UNIT_TESTS_DATA_PLUGIN_DIR', TESTS_PLUGIN_DIR . '/tests/Data/' );
// Define WP_CORE_DIR if not already defined
if ( ! defined( 'WP_CORE_DIR' ) ) {
$_wp_core_dir = getenv( 'WP_CORE_DIR' );
if ( ! $_wp_core_dir ) {
$_wp_core_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress';
}
define( 'WP_CORE_DIR', $_wp_core_dir );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment