From 007613a5aba1777fdc3731090ac53b9c4ce2f212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alda=20Vigd=C3=ADs=20Skarph=C3=A9=C3=B0insd=C3=B3ttir?= Date: Fri, 22 Mar 2024 02:05:27 +0100 Subject: [PATCH] Moving the test environment inclusion into a separate function --- bootstrap.php | 1 + src/Bootstrap.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/bootstrap.php b/bootstrap.php index 3b92cf7..c3d83e1 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -12,3 +12,4 @@ SetEnv::setConfigFilePath(); Bootstrap::init(getenv('WP_VERSION')); +Bootstrap::requireWordPressTestEnv(); diff --git a/src/Bootstrap.php b/src/Bootstrap.php index dfa5fb4..7f7937e 100644 --- a/src/Bootstrap.php +++ b/src/Bootstrap.php @@ -384,7 +384,14 @@ public static function init(string $wp_version): void self::displayLine('Bye!', '👋'); self::displaySeparator(); + } + /** + * Require the WP test environment + * + * This enables us to use WordPress' built-in functions in our tests. + */ + public static function requireWordPressTestEnv(): void { require FetchWP::extractDirPath() . 'wordpress-develop-trunk/tests/phpunit/includes/functions.php';