From: Seamus Lee Date: Wed, 3 Aug 2016 08:59:27 +0000 (+1000) Subject: Fix mailing test and allow for name or label to be used in navigation as that seems... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7824ac7208b4120de36e6fc51e13b0ab9b83a823;p=civicrm-core.git Fix mailing test and allow for name or label to be used in navigation as that seems to be allowable --- diff --git a/api/v3/Navigation.php b/api/v3/Navigation.php index b7d0d05817..e550cfa1f7 100644 --- a/api/v3/Navigation.php +++ b/api/v3/Navigation.php @@ -93,7 +93,9 @@ function civicrm_api3_navigation_get($params) { * @param array $params */ function _civicrm_api3_navigation_create_spec(&$params) { - $params['name']['api.required'] = 1; + $params['domain_id']['api.default'] = CRM_Core_Config::domainID(); + $params['domain_id']['type'] = CRM_Utils_Type::T_INT; + $params['domain_id']['title'] = 'Domain ID'; } /** @@ -106,6 +108,7 @@ function _civicrm_api3_navigation_create_spec(&$params) { * API result array. */ function civicrm_api3_navigation_create($params) { + civicrm_api3_verify_one_mandatory($params, NULL, array('name', 'label')); return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); } diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index 7f5f21c4e5..df802be370 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -62,6 +62,8 @@ class api_v3_MailingTest extends CiviUnitTestCase { ); $this->footer = civicrm_api3('MailingComponent', 'create', array( + 'name' => 'test domain footer', + 'component_type' => 'footer', 'body_html' => '

From {domain.address}. To opt out, go to {action.optOutUrl}.

', 'body_text' => 'From {domain.address}. To opt out, go to {action.optOutUrl}.', )); diff --git a/tests/phpunit/api/v3/NavigationTest.php b/tests/phpunit/api/v3/NavigationTest.php index 1dea146e0a..85c69818b6 100644 --- a/tests/phpunit/api/v3/NavigationTest.php +++ b/tests/phpunit/api/v3/NavigationTest.php @@ -46,7 +46,7 @@ class api_v3_NavigationTest extends CiviUnitTestCase { * Test create function. */ public function testCreate() { - $params = array('name' => 'feed', 'label' => 'Feed the Goats', 'domain_id' => 1); + $params = array('label' => 'Feed the Goats', 'domain_id' => 1); $result = $this->callAPISuccess($this->_entity, 'create', $params); $this->getAndCheck($params, $result['id'], $this->_entity, TRUE); }