<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
*/
-require_once 'CiviTest/CiviUnitTestCase.php';
-
/**
* Test class for Domain API - civicrm_domain_*
*
/* This test case doesn't require DB reset - apart from
where cleanDB() is called. */
-
public $DBResetRequired = FALSE;
protected $_apiversion = 3;
// taken from form code - couldn't find good method to use
$params['entity_id'] = 1;
$params['entity_table'] = CRM_Core_BAO_Domain::getTableName();
- $domain = 1;
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
- $location = array();
$domContact = $this->callAPISuccess('contact', 'create', array(
'contact_type' => 'Organization',
'organization_name' => 'new org',
$this->assertArrayHasKey('id', $domain);
$this->assertArrayHasKey('name', $domain);
$this->assertArrayHasKey('domain_email', $domain);
- $this->assertArrayHasKey('domain_phone', $domain);
+ $this->assertEquals(array(
+ 'phone_type' => 'Phone',
+ 'phone' => '456-456',
+ ), $domain['domain_phone']);
$this->assertArrayHasKey('domain_address', $domain);
}
+ /**
+ * Test get function with current domain.
+ */
public function testGetCurrentDomain() {
$params = array('current_domain' => 1);
$result = $this->callAPISuccess('domain', 'get', $params);
}
}
- ///////////////// civicrm_domain_create methods
-
/**
- * This test checks for a memory leak observed when doing 2 gets on current domain
+ * This test checks for a memory leak.
+ *
+ * The leak was observed when doing 2 gets on current domain.
*/
public function testGetCurrentDomainTwice() {
$domain = $this->callAPISuccess('domain', 'getvalue', array(