Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/27/2014 05:37:38 PM (11 years ago)
Author:
boonebgorges
Message:

Return false friends_add_friend() when the initiator is the same as the friend

It's good to love yourself, but there's no real reason to allow
self-friendships in BuddyPress.

See #5319

Props megainfo, r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/friends/functions.php

    r8112 r8172  
    116116        $this->set_current_user( $old_user );
    117117    }
     118
     119    /**
     120     * @group friends_add_friend
     121     */
     122    public function test_friends_add_friend_fail_on_self() {
     123        $u1 = $this->create_user();
     124        $this->assertFalse( friends_add_friend( $u1, $u1 ) );
     125    }
    118126}
Note: See TracChangeset for help on using the changeset viewer.