WP_CONTENT_DIR . '/plugins/woocommerce/woocommerce.php', 'WPForms Lite' => WP_CONTENT_DIR . '/plugins/wpforms-lite/wpforms.php', ]; foreach ($required as $label => $entrypoint) { if (!is_readable($entrypoint)) { fwrite( STDERR, "extendify-sdk tests require $label at $entrypoint.\n" . "Install it under WP_CONTENT_DIR/plugins/ or set " . "EXTENDIFY_TEST_SKIP_OPTIONAL_PLUGINS=1 to skip the " . "WooCommerce + WPForms test paths.\n" ); exit(1); } require_once $entrypoint; } }); // WC builds its custom tables on activation; a bare require_once doesn't, and // its own init-time self-install is too late for the first test on the fresh // DB CI provisions each run. Mirrors WC's own PHPUnit bootstrap. tests_add_filter('setup_theme', function () { if (!class_exists('WC_Install')) { return; } \WC_Install::install(); $GLOBALS['wp_roles'] = new \WP_Roles(); // install() grants WC caps to roles }); require $_tests_dir . '/includes/bootstrap.php';