Example #1
0
 /**
  * @covers ::bbp_bump_user_reply_count
  */
 public function test_bbp_bump_user_reply_count()
 {
     $u = $this->factory->user->create();
     $int_value = 3;
     $integer = true;
     bbp_update_user_reply_count($u, $int_value);
     $count = bbp_get_user_reply_count($u, $integer);
     $this->assertSame($int_value, $count);
     bbp_bump_user_reply_count($u);
     $count = bbp_get_user_reply_count($u, $integer);
     $this->assertSame($int_value + 1, $count);
 }
Example #2
0
/**
 * Helper function used to increase (by one) the count of replies for a user when
 * a topic is unpublished.
 *
 * @since 2.6.0 bbPress (r5309)
 *
 * @param $reply_id
 */
function bbp_decrease_user_reply_count($reply_id = 0)
{
    $user_id = bbp_get_reply_author_id($reply_id);
    return bbp_bump_user_reply_count($user_id, -1);
}