Skip to content

Commit

Permalink
Update autoload path and plugin loading sequence in test bootstrap
Browse files Browse the repository at this point in the history
This commit updates two main aspects in the test bootstrap file. Firstly, it modifies the path of the autoload file required for prophecy from using __DIR__ to using __FILE__. This change is done to ensure correct file path resolution in different environments.
Secondly, the loading sequence of the apple-news.php plugin has been changed. It is now loaded inside the BC_Setup initialization closure, guaranteeing its availability before the 'install' method execution. This adjustment ensures the correct plugin loading
  • Loading branch information
attackant committed Nov 3, 2023
1 parent 3834a76 commit 4e3e330
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function apple_news_require_file( string $file ) {
}

// Autoloading for prophecy.
apple_news_require_file( dirname( __DIR__ ) . '/vendor/autoload.php' );
apple_news_require_file( dirname( dirname( __FILE__ ) ) . '/vendor/autoload.php' );

/**
* Install WordPress and load the plugin.
Expand Down Expand Up @@ -67,11 +67,11 @@ function () {
// Activate mocked Brightcove functionality.
$bc_setup = new BC_Setup();
$bc_setup->action_init();
}
)
// Load the plugin.
->install();

// Load the plugin.
require dirname( dirname( __FILE__ ) ) . '/apple-news.php';
}
)->install();

// Disable CAP by default - make it opt-in in tests.
tests_add_filter( 'apple_news_use_coauthors', '__return_false' );
Expand Down

0 comments on commit 4e3e330

Please sign in to comment.