Skip to content

Commit

Permalink
Merge pull request #12295 from eileenmcnaughton/mailing
Browse files Browse the repository at this point in the history
Confirm & lock in group.get handling of is_active
  • Loading branch information
seamuslee001 authored Jun 11, 2018
2 parents 165bc6f + a3b559e commit 7d60956
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/phpunit/api/v3/GroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function setUp() {
* Clean up after test.
*/
public function tearDown() {
$this->groupDelete($this->_groupID);
CRM_Utils_Hook::singleton()->reset();
$config = CRM_Core_Config::singleton();
unset($config->userPermissionClass->permissions);
$this->quickCleanup(['civicrm_group', 'civicrm_group_contact']);
}

/**
Expand Down Expand Up @@ -85,6 +85,17 @@ public function testGetGroupWithEmptyParams() {
$this->assertEquals($group[$this->_groupID]['visibility'], 'Public Pages');
}

/**
* Test ability to get active, inactive and both.
*
* Default is active only.
*/
public function testGetGroupActiveAndInactive() {
$this->groupCreate(['is_active' => 0, 'name' => 'group_2', 'title' => 2]);
$group1 = $this->callAPISuccessGetSingle('Group', ['is_active' => 1]);
$this->callAPISuccessGetCount('Group', [], 2);
}

public function testGetGroupParamsWithGroupId() {
$params = array('id' => $this->_groupID);
$group = $this->callAPISuccess('group', 'get', $params);
Expand Down

0 comments on commit 7d60956

Please sign in to comment.