fix membershiptypetest
[civicrm-core.git] / tests / phpunit / api / v3 / CustomGroupTest.php
index 26f1509f780f5a77b3ce101981895bad8a74b91a..4816f1157ddea0db04051b1dd44a53e09456c2aa 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -66,7 +66,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
   ///////////////// civicrm_custom_group_create methods
 
   /**
-   * Check with empty array
+   * Check with empty array.
    * note that these tests are of marginal value so should not be included in copy & paste
    * code. The SyntaxConformance is capable of testing this for all entities on create
    * & delete (& it would be easy to add if not there)
@@ -78,7 +78,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check with empty array
+   * Check with empty array.
    */
   public function testCustomGroupCreateNoExtends() {
     $params = array(
@@ -94,12 +94,12 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $customGroup = $this->callAPIFailure('custom_group', 'create', $params);
-    $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends', 'In line ' . __LINE__);
+    $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends');
     $this->assertAPIFailure($customGroup, 'In line ' . __LINE__);
   }
 
   /**
-   * Check with empty array
+   * Check with empty array.
    */
   public function testCustomGroupCreateInvalidExtends() {
     $params = array(
@@ -116,11 +116,11 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $customGroup = $this->callAPIFailure('custom_group', 'create', $params);
-    $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends', 'In line ' . __LINE__);
+    $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends');
   }
 
   /**
-   * Check with a string instead of array for extends
+   * Check with a string instead of array for extends.
    */
   public function testCustomGroupCreateExtendsString() {
     $params = array(
@@ -140,7 +140,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check with valid array
+   * Check with valid array.
    */
   public function testCustomGroupCreate() {
     $params = array(
@@ -156,12 +156,12 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $result = $this->callAPIAndDocument('custom_group', 'create', $params, __FUNCTION__, __FILE__);
-    $this->assertNotNull($result['id'], 'In line ' . __LINE__);
-    $this->assertEquals($result['values'][$result['id']]['extends'], 'Individual', 'In line ' . __LINE__);
+    $this->assertNotNull($result['id']);
+    $this->assertEquals($result['values'][$result['id']]['extends'], 'Individual');
   }
 
   /**
-   * Check with valid array
+   * Check with valid array.
    */
   public function testCustomGroupGetFields() {
     $params = array(
@@ -198,7 +198,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check with style missing from params array
+   * Check with style missing from params array.
    */
   public function testCustomGroupCreateNoStyle() {
     $params = array(
@@ -213,21 +213,21 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $customGroup = $this->callAPISuccess('custom_group', 'create', $params);
-    $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__);
-    $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Inline', 'In line ' . __LINE__);
+    $this->assertNotNull($customGroup['id']);
+    $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Inline');
   }
 
   /**
-   * Check with not array
+   * Check with not array.
    */
   public function testCustomGroupCreateNotArray() {
     $params = NULL;
     $customGroup = $this->callAPIFailure('custom_group', 'create', $params);
-    $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__);
+    $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array');
   }
 
   /**
-   * Check without title
+   * Check without title.
    */
   public function testCustomGroupCreateNoTitle() {
     $params = array(
@@ -244,7 +244,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check for household without weight
+   * Check for household without weight.
    */
   public function testCustomGroupCreateHouseholdNoWeight() {
     $params = array(
@@ -259,13 +259,13 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $customGroup = $this->callAPISuccess('custom_group', 'create', $params);
-    $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__);
-    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Household', 'In line ' . __LINE__);
-    $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Tab', 'In line ' . __LINE__);
+    $this->assertNotNull($customGroup['id']);
+    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Household');
+    $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Tab');
   }
 
   /**
-   * Check for Contribution Donation
+   * Check for Contribution Donation.
    */
   public function testCustomGroupCreateContributionDonation() {
     $params = array(
@@ -281,12 +281,12 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $customGroup = $this->callAPISuccess('custom_group', 'create', $params);
-    $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__);
-    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Contribution', 'In line ' . __LINE__);
+    $this->assertNotNull($customGroup['id']);
+    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Contribution');
   }
 
   /**
-   * Check with valid array
+   * Check with valid array.
    */
   public function testCustomGroupCreateGroup() {
     $params = array(
@@ -303,8 +303,8 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $customGroup = $this->callAPISuccess('custom_group', 'create', $params);
-    $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__);
-    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Group', 'In line ' . __LINE__);
+    $this->assertNotNull($customGroup['id']);
+    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Group');
   }
 
   /**
@@ -323,31 +323,31 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     );
 
     $customGroup = $this->callAPISuccess('custom_group', 'create', $params);
-    $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__);
-    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Activity', 'In line ' . __LINE__);
+    $this->assertNotNull($customGroup['id']);
+    $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Activity');
   }
 
   ///////////////// civicrm_custom_group_delete methods
 
   /**
-   * Check without GroupID
+   * Check without GroupID.
    */
   public function testCustomGroupDeleteWithoutGroupID() {
     $customGroup = $this->callAPIFailure('custom_group', 'delete', array());
-    $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: id', 'In line ' . __LINE__);
+    $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: id');
   }
 
   /**
-   * Check with no array
+   * Check with no array.
    */
   public function testCustomGroupDeleteNoArray() {
     $params = NULL;
     $customGroup = $this->callAPIFailure('custom_group', 'delete', $params);
-    $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__);
+    $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array');
   }
 
   /**
-   * Check with valid custom group id
+   * Check with valid custom group id.
    */
   public function testCustomGroupDelete() {
     $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group'));
@@ -359,7 +359,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
   }
 
   /**
-   * Main success get function
+   * Main success get function.
    */
   public function testGetCustomGroupSuccess() {