Skip to content

Commit

Permalink
Fix WP_CLI logger class not found issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Jan 18, 2024
1 parent 92abfc5 commit 5c5b8dd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ function pwa_unit_test_load_plugin_file() {
*/
define( 'WP_CLI_ROOT', TESTS_PLUGIN_DIR . '/vendor/wp-cli/wp-cli' );
define( 'WP_CLI_VENDOR_DIR', TESTS_PLUGIN_DIR . '/vendor' );
require_once WP_CLI_ROOT . '/php/utils.php';

$logger = new WP_CLI\Loggers\Regular( true );
WP_CLI::set_logger( $logger );
if ( file_exists( WP_CLI_ROOT . '/php/utils.php' ) ) {
require_once WP_CLI_ROOT . '/php/utils.php';
WP_CLI\Utils\load_dependencies();

$logger = new WP_CLI\Loggers\Regular( true );
WP_CLI::set_logger( $logger );
}

// Start up the WP testing environment.
require $_test_root . '/includes/bootstrap.php';

0 comments on commit 5c5b8dd

Please sign in to comment.