From 63c9befe4416fbf438eef9625930c5a94aefd118 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 11 Sep 2013 22:30:40 -0700 Subject: [PATCH] MessageTemplate - Change APIv3 references from "MessageTemplates" to "MessageTemplate" --- api/v3/MessageTemplates.php | 18 +++++++++--------- tests/phpunit/api/v3/MessageTemplatesTest.php | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/v3/MessageTemplates.php b/api/v3/MessageTemplates.php index 2850c9e095..80fc3abe19 100644 --- a/api/v3/MessageTemplates.php +++ b/api/v3/MessageTemplates.php @@ -26,7 +26,7 @@ */ /** - * File for the CiviCRM APIv3 message_templates functions + * File for the CiviCRM APIv3 message_template functions * * @package CiviCRM_SEPA * @@ -36,7 +36,7 @@ /** * @access public */ -function civicrm_api3_message_templates_create($params) { +function civicrm_api3_message_template_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); } @@ -46,7 +46,7 @@ function civicrm_api3_message_templates_create($params) { * The metadata is used for setting defaults, documentation & validation * @param array $params array or parameters determined by getfields */ -function _civicrm_api3_message_templates_create_spec(&$params) { +function _civicrm_api3_message_template_create_spec(&$params) { $params['msg_title']['api.required'] = 1; $params['is_active']['api.default'] = true; /* $params['entity_id']['api.required'] = 1; @@ -59,18 +59,18 @@ function _civicrm_api3_message_templates_create_spec(&$params) { * @param array $params * * @return boolean | error true if successfull, error otherwise - * {@getfields message_templates_delete} + * {@getfields message_template_delete} * @access public */ -function civicrm_api3_message_templates_delete($params) { +function civicrm_api3_message_template_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); } -function _civicrm_api3_message_templates_get_spec(&$params) { +function _civicrm_api3_message_template_get_spec(&$params) { } /** - * Retrieve one or more message_templatess + * Retrieve one or more message_template * * @param array input parameters * @@ -80,10 +80,10 @@ function _civicrm_api3_message_templates_get_spec(&$params) { * @param array $params an associative array of name/value pairs. * * @return array api result array - * {@getfields message_templates_get} + * {@getfields message_template_get} * @access public */ -function civicrm_api3_message_templates_get($params) { +function civicrm_api3_message_template_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } diff --git a/tests/phpunit/api/v3/MessageTemplatesTest.php b/tests/phpunit/api/v3/MessageTemplatesTest.php index a038ddb5fc..8636a27ac6 100644 --- a/tests/phpunit/api/v3/MessageTemplatesTest.php +++ b/tests/phpunit/api/v3/MessageTemplatesTest.php @@ -32,11 +32,11 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * * @package CiviCRM_APIv3 */ -class api_v3_MessageTemplatesTest extends CiviUnitTestCase { +class api_v3_MessageTemplateTest extends CiviUnitTestCase { /** * Assume empty database with just civicrm_data */ - protected $entity = 'MessageTemplates'; + protected $entity = 'MessageTemplate'; protected $params; @@ -62,7 +62,7 @@ class api_v3_MessageTemplatesTest extends CiviUnitTestCase { * test create function succeeds */ public function testCreate() { - $result = $this->callAPIAndDocument('MessageTemplates', 'create', $this->params, __FUNCTION__, __FILE__); + $result = $this->callAPIAndDocument('MessageTemplate', 'create', $this->params, __FUNCTION__, __FILE__); $this->getAndCheck($this->params, $result['id'], $this->entity); } @@ -73,7 +73,7 @@ class api_v3_MessageTemplatesTest extends CiviUnitTestCase { * */ public function testGet() { - $result = $this->callAPIAndDocument('MessageTemplates', 'get', $this->params, __FUNCTION__, __FILE__); + $result = $this->callAPIAndDocument('MessageTemplate', 'get', $this->params, __FUNCTION__, __FILE__); $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); } @@ -83,7 +83,7 @@ class api_v3_MessageTemplatesTest extends CiviUnitTestCase { */ public function testDelete() { $entity = $this->createTestEntity(); - $result = $this->callAPIAndDocument('MessageTemplates', 'delete', array('id' => $entity['id']), __FUNCTION__, __FILE__); + $result = $this->callAPIAndDocument('MessageTemplate', 'delete', array('id' => $entity['id']), __FUNCTION__, __FILE__); $checkDeleted = $this->callAPISuccess($this->entity, 'get', array( 'id' => $entity['id'] )); -- 2.25.1