test failure fix2
[civicrm-core.git] / tests / phpunit / api / v3 / DomainTest.php
index d6f3431997f53f7ea17893223469cc60860f1876..430f74d6cc50f6ec96d3c690e2cf4e0b7ef212d4 100644 (file)
@@ -30,8 +30,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for Domain API - civicrm_domain_*
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Domain
+ * @package CiviCRM_APIv3
+ * @subpackage API_Domain
  */
 class api_v3_DomainTest extends CiviUnitTestCase {
 
@@ -39,7 +39,6 @@ class api_v3_DomainTest extends CiviUnitTestCase {
        where cleanDB() is called. */
 
 
-
   public $DBResetRequired = FALSE;
 
   protected $_apiversion = 3;
@@ -48,8 +47,6 @@ class api_v3_DomainTest extends CiviUnitTestCase {
   /**
    * Sets up the fixture, for example, opens a network connection.
    * This method is called before a test is executed.
-   *
-   * @access protected
    */
   protected function setUp() {
     parent::setUp();
@@ -62,27 +59,27 @@ class api_v3_DomainTest extends CiviUnitTestCase {
     $defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
     $location = array();
     $domContact = $this->callAPISuccess('contact', 'create', array(
-      'contact_type' => 'Organization',
-      'organization_name' => 'new org',
-      'api.phone.create' => array(
-        'location_type_id' => $defaultLocationType->id,
-        'phone_type_id' => 1,
-        'phone' => '456-456',
-       ),
-      'api.address.create' => array(
-        'location_type_id' => $defaultLocationType->id,
-        'street_address' => '45 Penny Lane',
+        'contact_type' => 'Organization',
+        'organization_name' => 'new org',
+        'api.phone.create' => array(
+          'location_type_id' => $defaultLocationType->id,
+          'phone_type_id' => 1,
+          'phone' => '456-456',
+        ),
+        'api.address.create' => array(
+          'location_type_id' => $defaultLocationType->id,
+          'street_address' => '45 Penny Lane',
+        ),
+        'api.email.create' => array(
+          'location_type_id' => $defaultLocationType->id,
+          'email' => 'my@email.com',
         ),
-      'api.email.create' => array(
-        'location_type_id' => $defaultLocationType->id,
-        'email' => 'my@email.com',
-      )
       )
     );
 
-    $this->callAPISuccess('domain','create',array(
-      'id' => 1,
-      'contact_id' => $domContact['id'],
+    $this->callAPISuccess('domain', 'create', array(
+        'id' => 1,
+        'contact_id' => $domContact['id'],
       )
     );
     $this->params = array(
@@ -101,7 +98,7 @@ class api_v3_DomainTest extends CiviUnitTestCase {
    */
   public function testGet() {
 
-    $params = array('sequential' => 1,);
+    $params = array('sequential' => 1);
     $result = $this->callAPIAndDocument('domain', 'get', $params, __FUNCTION__, __FILE__);
 
     $this->assertType('array', $result);
@@ -139,9 +136,9 @@ class api_v3_DomainTest extends CiviUnitTestCase {
       $this->assertArrayHasKey('domain_email', $domain);
       $this->assertArrayHasKey('domain_phone', $domain);
       $this->assertArrayHasKey('domain_address', $domain);
-      $this->assertEquals("my@email.com",$domain['domain_email']);
-      $this->assertEquals("456-456",$domain['domain_phone']['phone']);
-      $this->assertEquals("45 Penny Lane",$domain['domain_address']['street_address']);
+      $this->assertEquals("my@email.com", $domain['domain_email']);
+      $this->assertEquals("456-456", $domain['domain_phone']['phone']);
+      $this->assertEquals("45 Penny Lane", $domain['domain_address']['street_address']);
     }
   }
 
@@ -151,17 +148,16 @@ class api_v3_DomainTest extends CiviUnitTestCase {
     */
 
 
-
   public function testGetCurrentDomainTwice() {
     $domain = $this->callAPISuccess('domain', 'getvalue', array(
-        'current_domain' => 1,
-        'return' => 'name',
-      ));
+      'current_domain' => 1,
+      'return' => 'name',
+    ));
     $this->assertEquals('Default Domain Name', $domain, print_r($domain, TRUE));
     $domain = $this->callAPISuccess('domain', 'getvalue', array(
-        'current_domain' => 1,
-        'return' => 'name',
-      ));
+      'current_domain' => 1,
+      'return' => 'name',
+    ));
     $this->assertEquals('Default Domain Name', $domain, print_r($domain, TRUE));
   }
 
@@ -184,4 +180,3 @@ class api_v3_DomainTest extends CiviUnitTestCase {
     $result = $this->callAPIFailure('domain', 'create', array());
   }
 }
-