- Timestamp:
- 01/06/2015 03:38:23 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/groups/class-bp-groups-member.php
r9293 r9300 133 133 */ 134 134 public function test_bp_groups_user_can_send_invites() { 135 $u_nonmembers = $this->factory->user->create(); 135 136 $u_members = $this->factory->user->create(); 136 137 $u_mods = $this->factory->user->create(); … … 165 166 // In bp_group_get_invite_status(), no status falls back to "members" 166 167 $this->assertTrue( '' == groups_get_groupmeta( $g, 'invite_status' ) ); 168 $this->assertFalse( bp_groups_user_can_send_invites( $g, $u_nonmembers ) ); 167 169 $this->assertTrue( bp_groups_user_can_send_invites( $g, $u_members ) ); 168 170 $this->assertTrue( bp_groups_user_can_send_invites( $g, $u_mods ) ); … … 172 174 // Test with members status 173 175 groups_update_groupmeta( $g, 'invite_status', 'members' ); 176 $this->assertFalse( bp_groups_user_can_send_invites( $g, $u_nonmembers ) ); 174 177 $this->assertTrue( bp_groups_user_can_send_invites( $g, $u_members ) ); 175 178 $this->assertTrue( bp_groups_user_can_send_invites( $g, $u_mods ) ); … … 182 185 // Test with mod status 183 186 groups_update_groupmeta( $g, 'invite_status', 'mods' ); 187 $this->assertFalse( bp_groups_user_can_send_invites( $g, $u_nonmembers ) ); 184 188 $this->assertFalse( bp_groups_user_can_send_invites( $g, $u_members ) ); 185 189 $this->assertTrue( bp_groups_user_can_send_invites( $g, $u_mods ) ); … … 194 198 // Test with admin status 195 199 groups_update_groupmeta( $g, 'invite_status', 'admins' ); 200 $this->assertFalse( bp_groups_user_can_send_invites( $g, $u_nonmembers ) ); 196 201 $this->assertFalse( bp_groups_user_can_send_invites( $g, $u_members ) ); 197 202 $this->assertFalse( bp_groups_user_can_send_invites( $g, $u_mods ) ); … … 212 217 $g_obj = groups_get_group( array( 'group_id' => $g ) ); 213 218 $this->go_to( bp_get_group_permalink( $g_obj ) ); 214 groups_update_groupmeta( $g, 'invite_status', 'members' ); 215 216 $this->assertTrue( bp_groups_user_can_send_invites( null, $u_members ) ); 219 groups_update_groupmeta( $g, 'invite_status', 'mods' ); 220 $this->assertFalse( bp_groups_user_can_send_invites( null, $u_nonmembers ) ); 221 $this->assertFalse( bp_groups_user_can_send_invites( null, $u_members ) ); 222 $this->assertTrue( bp_groups_user_can_send_invites( null, $u_mods ) ); 217 223 218 224 $this->set_current_user( $old_current_user );
Note: See TracChangeset
for help on using the changeset viewer.