Skip to:
Content

BuddyPress.org

Changeset 10868


Ignore:
Timestamp:
06/02/2016 02:14:54 AM (9 years ago)
Author:
r-a-y
Message:

Fix unit test for #7107.

This test broke after the "Comment Blacklist" moderation filter no longer
marks activity items as spam. (See r10860.)

To fix the test, we explicitly set the new activity item as spam.

File:
1 edited

Legend:

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

    r10854 r10868  
    704704        ) );
    705705
    706         // Update 'Comment blacklist' section to include some words we want to block.
    707         update_option( 'blacklist_keys', 'yolo' );
     706        // Set activity item to spam.
     707        add_action( 'bp_activity_before_save', array( $this, 'set_activity_to_spam' ) );
    708708
    709709        // Create spammed activity comment.
     
    723723        // Reset.
    724724        remove_filter( 'bp_disable_blogforum_comments', '__return_false' );
    725         update_option( 'blacklist_keys', '' );
     725        remove_action( 'bp_activity_before_save', array( $this, 'set_activity_to_spam' ) );
    726726
    727727        $this->set_current_user( $old_user );
     
    754754        return $a;
    755755    }
     756
     757    /**
     758     * Explicitly set activity to spam.
     759     */
     760    public function set_activity_to_spam( $activity ) {
     761        $activity->is_spam = 1;
     762    }
    756763}
Note: See TracChangeset for help on using the changeset viewer.