Merge pull request #5536 from totten/4.5-httpclient
[civicrm-core.git] / tests / phpunit / api / v3 / RelationshipTypeTest.php
index d0b15dbc6b7b9e7c56bf046e4f5ca5b7fcb851e6..42ac0a995ff85ab8446ae62fe947246765b6ea04 100644 (file)
@@ -1,10 +1,9 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
 | CiviCRM version 4.6                                                |
 +--------------------------------------------------------------------+
-| Copyright CiviCRM LLC (c) 2004-2014                                |
+| Copyright CiviCRM LLC (c) 2004-2015                                |
 +--------------------------------------------------------------------+
 | This file is a part of CiviCRM.                                    |
 |                                                                    |
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
-*/
+ */
 
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -50,7 +49,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
@@ -67,8 +66,8 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   public function setUp() {
 
     parent::setUp();
-    $this->_cId_a      = $this->individualCreate();
-    $this->_cId_b      = $this->organizationCreate();
+    $this->_cId_a = $this->individualCreate();
+    $this->_cId_b = $this->organizationCreate();
   }
 
   public function tearDown() {
@@ -83,7 +82,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   ///////////////// civicrm_relationship_type_add methods
 
   /**
-   * Check with no name
+   * Check with no name.
    */
   public function testRelationshipTypeCreateWithoutName() {
     $relTypeParams = array(
@@ -96,7 +95,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check with no contact type
+   * Check with no contact type.
    */
   public function testRelationshipTypeCreateWithoutContactType() {
     $relTypeParams = array(
@@ -109,7 +108,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   * Create relationship type
+   * Create relationship type.
    */
   public function testRelationshipTypeCreate() {
     $params = array(
@@ -129,7 +128,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   *  Test  using example code
+   * Test  using example code.
    */
   public function testRelationshipTypeCreateExample() {
     require_once 'api/v3/examples/RelationshipType/Create.php';
@@ -139,7 +138,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check if required fields are not passed
+   * Check if required fields are not passed.
    */
   public function testRelationshipTypeDeleteWithoutRequired() {
     $params = array(
@@ -154,7 +153,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check with incorrect required fields
+   * Check with incorrect required fields.
    */
   public function testRelationshipTypeDeleteWithIncorrectData() {
     $params = array(
@@ -172,13 +171,13 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check relationship type delete
+   * Check relationship type delete.
    */
   public function testRelationshipTypeDelete() {
     $id = $this->_relationshipTypeCreate();
     // create sample relationship type.
     $params = array(
-      'id' =>  $id,
+      'id' => $id,
     );
     $result = $this->callAPIAndDocument('relationship_type', 'delete', $params, __FUNCTION__, __FILE__);
     $this->assertAPIDeleted('relationship_type', $id);
@@ -187,7 +186,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   ///////////////// civicrm_relationship_type_update
 
   /**
-   * Check with empty array
+   * Check with empty array.
    */
   public function testRelationshipTypeUpdateEmpty() {
     $params = array();
@@ -196,7 +195,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check with no contact type
+   * Check with no contact type.
    */
   public function testRelationshipTypeUpdateWithoutContactType() {
     // create sample relationship type.
@@ -218,7 +217,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check with all parameters
+   * Check with all parameters.
    */
   public function testRelationshipTypeUpdate() {
     // create sample relationship type.
@@ -245,7 +244,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   ///////////////// civicrm_relationship_types_get methods
 
   /**
-   * Check with empty array
+   * Check with empty array.
    */
   public function testRelationshipTypesGetEmptyParams() {
     $firstRelTypeParams = array(
@@ -323,6 +322,8 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
 
   /**
    * Create relationship type.
+   * @param null $params
+   * @return mixed
    */
   public function _relationshipTypeCreate($params = NULL) {
     if (!is_array($params) || empty($params)) {
@@ -339,4 +340,5 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
 
     return $this->relationshipTypeCreate($params);
   }
+
 }