Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2017 09:11:52 PM (7 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.php

    r11256 r11739  
    1313    protected static $user_ids     = array();
    1414
    15     public static function setUpBeforeClass() {
    16         parent::setUpBeforeClass();
    17 
    18         $factory = new BP_UnitTest_Factory();
    19 
     15    public static function wpSetUpBeforeClass( $factory ) {
    2016        self::$old_user_id  = get_current_user_id();
    2117        self::$current_user = $factory->user->create( array(
Note: See TracChangeset for help on using the changeset viewer.