CRM-17120 remove call to uncached getLabel function
[civicrm-core.git] / tests / phpunit / api / v3 / DomainTest.php
index a13be7966ba9d25752f8d7ab817aff1e112b7350..ad23eacb5c1143685711c59ab3573b7d77b7325e 100644 (file)
@@ -38,7 +38,6 @@ class api_v3_DomainTest extends CiviUnitTestCase {
   /* This test case doesn't require DB reset - apart from
   where cleanDB() is called. */
 
-
   public $DBResetRequired = FALSE;
 
   protected $_apiversion = 3;
@@ -56,9 +55,7 @@ class api_v3_DomainTest extends CiviUnitTestCase {
     // 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',
@@ -112,10 +109,16 @@ class api_v3_DomainTest extends CiviUnitTestCase {
     $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);
@@ -143,10 +146,10 @@ class api_v3_DomainTest extends CiviUnitTestCase {
     }
   }
 
-  ///////////////// 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(