You are here

public function OgAccessModeratedGroup::testMemberShipRequestStatusWithState in Organic groups 7.2

Test that membership requests made via direct API calls that include membership state result in proper active status for private groups that require approval.

File

og_access/og_access.test, line 474
Test organic groups access module.

Class

OgAccessModeratedGroup
Tests moderated group memberships.

Code

public function testMemberShipRequestStatusWithState() {

  // Save user as a member of the group, passing the state.
  $this->user->og_user_node[LANGUAGE_NONE][0]['target_id'] = $this->group->nid;
  $this->user->og_user_node[LANGUAGE_NONE][0]['state'] = OG_STATE_ACTIVE;
  user_save($this->user);

  // User's membership should be active.
  $membership = og_get_membership('node', $this->group->nid, 'user', $this->user->uid);
  $this
    ->assertEqual($membership->state, OG_STATE_ACTIVE, t('User membership is active.'));
}