From 3c8e2962d7d5dd9bbe7341c13e21cac23cc1bc9c Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Fri, 4 Jan 2019 12:56:59 +0000 Subject: [PATCH] Added api test to support fix --- tests/phpunit/api/v3/ContactTest.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index 3ae1d26020..d768113bdf 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -3842,6 +3842,31 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertEquals(array('external_identifier'), $result['values']['UI_external_identifier']); } + /** + * API test to retrieve contact from group having different group title and name. + */ + public function testContactGetFromGroup() { + $groupId = $this->groupCreate([ + 'name' => 'Test_Group', + 'domain_id' => 1, + 'title' => 'New Test Group Created', + 'description' => 'New Test Group Created', + 'is_active' => 1, + 'visibility' => 'User and User Admin Only', + ]); + $contact = $this->callAPISuccess('contact', 'create', $this->_params); + $groupContactCreateParams = array( + 'contact_id' => $contact['id'], + 'group_id' => $groupId, + 'status' => 'Pending', + ); + $groupContact = $this->callAPISuccess('groupContact', 'create', $groupContactCreateParams); + $groupGetContact = $this->CallAPISuccess('groupContact', 'get', $groupContactCreateParams); + $this->CallAPISuccess('Contact', 'getcount', [ + 'group' => "Test_Group", + ]); + } + public function testSmartGroupsForRelatedContacts() { $rtype1 = $this->callAPISuccess('relationship_type', 'create', array( "name_a_b" => uniqid() . " Child of", -- 2.25.1