From 98a6b50c326f11ec44f920cb673a54c2666ab664 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 16 Mar 2020 09:55:22 +1100 Subject: [PATCH] [NFC] Add in unit test for creating a new system work flow message template with only edit system workflow message templates permission --- tests/phpunit/api/v3/MessageTemplateTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/api/v3/MessageTemplateTest.php b/tests/phpunit/api/v3/MessageTemplateTest.php index 8d38dd0fb8..148b68d736 100644 --- a/tests/phpunit/api/v3/MessageTemplateTest.php +++ b/tests/phpunit/api/v3/MessageTemplateTest.php @@ -103,6 +103,10 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase { 'msg_subject' => 'test msg permission subject', 'check_permissions' => TRUE, ]); + $newEntityParams = $entity['values'][$entity['id']]; + unset($newEntityParams['id']); + $newEntityParams['check_permissions'] = TRUE; + $this->callAPISuccess('MessageTemplate', 'create', $newEntityParams); // verify with all 3 permissions someone can do everything. CRM_Core_Config::singleton()->userPermissionClass->permissions = [ 'edit system workflow message templates', -- 2.25.1