Skip to content

Commit

Permalink
Merge pull request #7 from costdev/plugin-dependencies/do_not_load_in…
Browse files Browse the repository at this point in the history
…_bootstrap_during_test_suite

Don't load in bootstrap during test suite.
  • Loading branch information
afragen authored Jan 20, 2024
2 parents 9b13f05 + d1f084c commit 179537f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,10 @@
$GLOBALS['wp_plugin_paths'] = array();

// Load and initialize WP_Plugin_Dendencies.
require_once ABSPATH . WPINC . '/class-wp-plugin-dependencies.php';
WP_Plugin_Dependencies::initialize();
if ( ! defined( 'WP_RUN_CORE_TESTS' ) ) {
require_once ABSPATH . WPINC . '/class-wp-plugin-dependencies.php';
WP_Plugin_Dependencies::initialize();
}

// Load must-use plugins.
foreach ( wp_get_mu_plugins() as $mu_plugin ) {
Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/tests/admin/plugin-dependencies/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ abstract class WP_PluginDependencies_UnitTestCase extends WP_UnitTestCase {
public static function set_up_before_class() {
parent::set_up_before_class();

require_once ABSPATH . WPINC . '/class-wp-plugin-dependencies.php';

self::$instance = new WP_Plugin_Dependencies();
self::$plugins_dir = WP_PLUGIN_DIR . '/wp_plugin_dependencies_plugin';
@mkdir( self::$plugins_dir );
Expand Down

0 comments on commit 179537f

Please sign in to comment.