From: Eileen McNaughton Date: Mon, 25 Aug 2014 08:16:32 +0000 (+1200) Subject: CRM-15168 fix test to cope with problems with getactions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7385c76134c9031970f9bdcb6231ae3d4ed08af4;p=civicrm-core.git CRM-15168 fix test to cope with problems with getactions --- diff --git a/api/v3/MessageTemplate.php b/api/v3/MessageTemplate.php index 809db8fcbe..6dd039d72c 100644 --- a/api/v3/MessageTemplate.php +++ b/api/v3/MessageTemplate.php @@ -105,13 +105,12 @@ function civicrm_api3_message_template_send($params) { * @param array $params array or parameters determined by getfields */ function _civicrm_api3_message_template_send_spec(&$params) { - $required = array( - 'messageTemplateID', - 'contactId', - 'toEmail', - 'toName', - ); - foreach ($required as $value) { - $params[$value]['api.required'] = 1; - } + $params['messageTemplateID']['api.required'] = 1; + $params['messageTemplateID']['title'] = 'Message Template ID'; + $params['contactId']['api.required'] = 1; + $params['contactId']['title'] = 'Contact ID'; + $params['toEmail']['api.required'] = 1; + $params['toEmail']['title'] = 'To Email'; + $params['toName']['api.required'] = 1; + $params['toName']['title'] = 'To Name'; } diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 97f1145a1d..b79acae7ff 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -1136,9 +1136,13 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { } $actions = $this->callAPISuccess($entity, 'getactions', array()); foreach ($actions['values'] as $action) { + if (substr($action, -7) == '_create' || substr($action, -4) == '_get' || substr($action, -7) == '_delete') { + //getactions can't distinguish between contribution_page.create & contribution_page.create + continue; + } $fields = $this->callAPISuccess($entity, 'getfields', array('action' => $action)); if (!empty($ids) && in_array($action, array('create', 'get'))) { - $this->assertArrayHasKey('custom_' . $ids['custom_field_id'], $fields['values']); + $this->assertArrayHasKey('custom_' . $ids['custom_field_id'], $fields['values']); } foreach ($fields['values'] as $fieldName => $fieldSpec) {