Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2017 09:11:52 PM (6 years ago)
Author:
boonebgorges
Message:

Ensure that shared user fixtures are fully cleaned up.

It's not possible to inherit WP 4.4's user cleanup between tests, because
the the deletion routine runs after the core test suite has unhooked
certain actions (such as BP's that are hooked to delete_user). So
we are forced to run necessary cleanup tasks in our own delete_user()
method, and ensure that it's this method that is called in every case
where we're cleaning up after statically generated shared fixtures.
Otherwise leftover content in the activity table can leak to other
tests.

See #7620.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/suggestions-nonauth.php

    r9819 r11739  
    1111    protected static $user_ids     = array();
    1212
    13     public static function setUpBeforeClass() {
    14         parent::setUpBeforeClass();
    15 
     13    public static function wpSetUpBeforeClass( $factory ) {
    1614        $users = array(
    1715            // user_login, display_name
     
    2826            array( 'zoom',        'Lisa Smithy' ),
    2927        );
    30 
    31         $factory = new BP_UnitTest_Factory();
    3228
    3329        // Create some dummy users.
Note: See TracChangeset for help on using the changeset viewer.