From a627697dcbfa2a81c4d7abb67e952cb1cda44c64 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Sat, 24 Mar 2018 17:16:47 +0000 Subject: [PATCH] Add 'send SMS' permission before running tests --- tests/phpunit/CRM/Activity/BAO/ActivityTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index cb74742666..33bcacb798 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -1265,16 +1265,17 @@ $text $activityParams['sms_text_message'] = __FUNCTION__ . ' text'; $activityParams['activity_subject'] = __FUNCTION__ . ' subject'; - // ActivityParams is overwritten by sendSms but we need it for results - $activityParamsCopy = $activityParams; - // Get a "logged in" user to set as source of Sms. $session = CRM_Core_Session::singleton(); $sourceContactId = $session->get('userID'); - // Create a user, then a phone number + // Create a user $this->_testSmsContactId = $this->createLoggedInUser(); - // Create phone number + + // Give user permission to 'send SMS' + CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviCRM', 'send SMS'); + + // Create a phone number switch ($phoneType) { case 0: // No phone number -- 2.25.1