Skip to:
Content

BuddyPress.org

Changeset 9368


Ignore:
Timestamp:
01/17/2015 03:24:11 AM (12 years ago)
Author:
imath
Message:

Fix at mention notifications unit tests for WordPress < 4.0

Fixes #6129

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/activity/notifications.php

    r9139 r9368  
    1818                $this->u2 = $this->factory->user->create();
    1919                $this->set_current_user( $this->u1 );
     20
     21                /**
     22                 * Tests suite in WP < 4.0 does not include the WP_UnitTestCase->_restore_hooks() function
     23                 * When updating an activity, the following filter is fired to prevent sending more than one
     24                 * notification. Once we've reached this filter all at_mentions tests fails so we need to
     25                 * temporarly remove it and restore it in $this->tearDown()
     26                 */
     27                remove_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
    2028        }
    2129
    … …  
    2331                $this->set_current_user( $this->current_user );
    2432                parent::tearDown();
     33
     34                // Restore the filter
     35                add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
    2536        }
    2637
Note: See TracChangeset for help on using the changeset viewer.