From a3b559ee03253f4d5b6cf0b08c6434417fb6e529 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 11 Jun 2018 10:03:03 +1200 Subject: [PATCH] Confirm & lock in group.get handling of is_active --- tests/phpunit/api/v3/GroupTest.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/api/v3/GroupTest.php b/tests/phpunit/api/v3/GroupTest.php index 732a143a90a7..3308fd16cc84 100644 --- a/tests/phpunit/api/v3/GroupTest.php +++ b/tests/phpunit/api/v3/GroupTest.php @@ -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']); } /** @@ -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);