Skip to content

Commit

Permalink
Moving the test environment inclusion into a separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
aldavigdis committed Mar 22, 2024
1 parent 882efd5 commit 007613a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
SetEnv::setConfigFilePath();

Bootstrap::init(getenv('WP_VERSION'));
Bootstrap::requireWordPressTestEnv();
7 changes: 7 additions & 0 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 007613a

Please sign in to comment.