Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/31/2024 08:09:06 PM (18 months ago)
Author:
imath
Message:

Update wp-env to version 9.0.0 & adapt the PHPUnit tests suite to it

  • Update PHPUnit related npm scripts for wp-env 9.0.0.
  • Create test_multi: a new composer script to run Multisite Unit tests.
  • Remove our composer dependency to wp-phpunit/wp-phpunit.
  • Update the PHPUnit tests suite so that it stops using wp-phpunit/wp-phpunit when it's within the wp-env context.
  • Remove no more used PHPUnit specific configuration files.

Fixes #9053
Closes https://github.com/buddypress/buddypress/pull/211

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/functions.php

    r13705 r13720  
    834834
    835835        $bp = buddypress();
     836        $reset_current_site = isset( $GLOBALS['current_site'] ) ? $GLOBALS['current_site'] : null;
    836837        $reset_bp_pages = $bp->pages;
    837838        $reset_bp_active_components = $bp->active_components;
     
    842843        ) );
    843844
     845        if ( defined( 'WP_HOME' ) ) {
     846            $GLOBALS['current_site']->domain = get_site( $b )->domain;
     847        }
     848
    844849        $bp->active_components['newcomponent'] = 1;
    845850        add_filter( 'bp_core_get_directory_page_default_titles', array( $this, 'add_newcomponent_page_title' ) );
     
    851856
    852857        $new_component_page_id = $bp_pages['newcomponent'];
     858
    853859        $this->assertNotSame( 'newcomponent', get_post_field( 'post_name', $new_component_page_id ), 'The component slug should not conflict with subsite name.' );
    854860
     
    858864        $bp->pages = $reset_bp_pages;
    859865        $bp->active_components = $reset_bp_active_components;
     866
     867        if ( defined( 'WP_HOME' ) ) {
     868            $GLOBALS['current_site'] = $reset_current_site;
     869        }
    860870    }
    861871
Note: See TracChangeset for help on using the changeset viewer.