Fix failing tests: Update install-wp-tests.sh, Cypress commands, and GitHub Actions workflows
This commit is contained in:
@@ -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' );
|
||||
|
||||
Reference in New Issue
Block a user