From 9b0a35c29b749e45380210b8843068f9d65d71a6 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 14 Sep 2016 21:51:56 +0000 Subject: [PATCH] Fix all array_column and switch to collect() function --- tests/phpunit/CRM/Contact/Page/AjaxTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CRM/Contact/Page/AjaxTest.php b/tests/phpunit/CRM/Contact/Page/AjaxTest.php index ffba602b73..cbc02de1b6 100644 --- a/tests/phpunit/CRM/Contact/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Contact/Page/AjaxTest.php @@ -230,9 +230,7 @@ class CRM_Contact_Page_AjaxTest extends CiviUnitTestCase { $this->groupContactCreate($groupId); $contactIds = array_merge($contactIds, CRM_Contact_BAO_Group::getGroupContacts($groupId)); } - $contactIds = array_map(function($element) { - return $element['contact_id']; - }, $contactIds); + $contactIds = CRM_Utils_Array::collect('contact_id', $contactIds); // create custom group with contact reference field $customGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'select_test_group')); @@ -255,7 +253,7 @@ class CRM_Contact_Page_AjaxTest extends CiviUnitTestCase { 'is_unit_test' => TRUE, ); $contactList = CRM_Contact_Page_AJAX::contactReference(); - $contactList = array_column($contactList, 'id'); + $contactList = CRM_Utils_Array::collect('id', $contactList); //assert each returned contact id to be present in group contact foreach ($contactList as $contactId) { -- 2.25.1