[buddypress-trac] [BuddyPress Trac] #6209: Add tests for group invitations and membership request functions

buddypress-trac noreply at wordpress.org
Tue Mar 10 01:13:17 UTC 2015

#6209: Add tests for group invitations and membership request functions
 Reporter:  dcavins                     |       Owner:  dcavins
     Type:  task                        |      Status:  assigned
 Priority:  normal                      |   Milestone:  2.3
Component:  Component - Groups          |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |

Comment (by dcavins):

 In `6209-working-tests.02.patch`, I've added passing behavior checks on
 `bp_groups_delete_membership_request()`, `bp_groups_reject_invite()`,
 `bp_groups_delete_invite()` and `bp_groups_uninvite_user()`.

 In `6209-correct-delete-behavior.03.patch` I've added tests that I think
 should describe the correct behavior of those functions, and modified
 `groups_uninvite_user()`, `groups_reject_invite()` and
 `groups_delete_membership_request()` so that they only do what they say
 they're going to do. Unfortunately, we were relying on the loose cannon
 behavior of `groups_uninvite_user()` to remove a confirmed member from a
 group in `groups_leave_group()` from a variety of contexts, so that fails
 with my tightening up of `groups_uninvite_user()`. (All uses of the other
 functions are targeted to invites or requests, so should not be affected.)
 I had to also modify `groups_remove_member()` so that it will work as
 expected when called in `groups_leave_group()`. (My wrangling of
 `bp_is_item_admin()` in `groups_remove_member()` seems like a hack.
 Suggestions welcome for how to improve that.) Finally, I've added tests to
 check the behavior of `groups_leave_group()` and `groups_join_group()`
 because of the changes to `groups_leave_group()`.

 Kind of a mess, after all.

 Thanks in advance for your comments.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6209#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list