Fix failing tests: Update install-wp-tests.sh, Cypress commands, and GitHub Actions workflows

This commit is contained in:
2025-04-23 04:26:06 +01:00
parent bb31e0e934
commit b1966067ea
20 changed files with 263 additions and 106 deletions

View File

@@ -6,7 +6,7 @@
* Author: WPALLSTARS
* License: GPL-2.0-or-later
*
* @package WPPluginStarterTemplate
* @package WP_Plugin_Starter_Template_For_AI_Coding
*/
// Exit if accessed directly.
@@ -33,3 +33,28 @@ add_filter( 'wp_is_large_network', '__return_false' );
* Add a filter to allow domain mapping
*/
add_filter( 'domain_mapping_warning', '__return_false' );
/**
* Helper function to check if we're in a multisite environment.
*
* @return bool True if multisite is enabled, false otherwise.
*/
function wpst_is_multisite() {
return defined( 'MULTISITE' ) && MULTISITE;
}
/**
* Helper function to get all sites in the network.
*
* @return array Array of site objects.
*/
function wpst_get_network_sites() {
if ( ! wpst_is_multisite() ) {
return array();
}
return get_sites( array( 'public' => 1 ) );
}
// Add a filter to enable multisite testing in PHPUnit.
add_filter( 'wpst_is_multisite_compatible', '__return_true' );