Coding standards cleanup sprint.
[civicrm-core.git] / tests / phpunit / api / v3 / RelationshipTypeTest.php
index 5764714fd0639e6ae95dd11e8ff601e417211245..9354fab545eeea634d7e61f41fbc30610bc02827 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
 | CiviCRM version 4.6                                                |
@@ -64,25 +63,14 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   protected $_relTypeID;
   protected $_apiversion = 3;
 
-  /**
-   * @return array
-   */
-  function get_info() {
-    return array(
-      'name' => 'RelationshipType Create',
-      'description' => 'Test all RelationshipType Create API methods.',
-      'group' => 'CiviCRM API Tests',
-    );
-  }
-
-  function setUp() {
+  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();
   }
 
-  function tearDown() {
+  public function tearDown() {
 
     $tablesToTruncate = array(
       'civicrm_contact',
@@ -96,7 +84,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with no name
    */
-  function testRelationshipTypeCreateWithoutName() {
+  public function testRelationshipTypeCreateWithoutName() {
     $relTypeParams = array(
       'contact_type_a' => 'Individual',
       'contact_type_b' => 'Organization',
@@ -109,7 +97,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with no contact type
    */
-  function testRelationshipTypeCreateWithoutContactType() {
+  public function testRelationshipTypeCreateWithoutContactType() {
     $relTypeParams = array(
       'name_a_b' => 'Relation 1 without contact type',
       'name_b_a' => 'Relation 2 without contact type',
@@ -122,7 +110,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Create relationship type
    */
-  function testRelationshipTypeCreate() {
+  public function testRelationshipTypeCreate() {
     $params = array(
       'name_a_b' => 'Relation 1 for relationship type create',
       'name_b_a' => 'Relation 2 for relationship type create',
@@ -142,7 +130,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    *  Test  using example code
    */
-  function testRelationshipTypeCreateExample() {
+  public function testRelationshipTypeCreateExample() {
     require_once 'api/v3/examples/RelationshipType/Create.php';
     $result = relationship_type_create_example();
     $expectedResult = relationship_type_create_expectedresult();
@@ -152,7 +140,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check if required fields are not passed
    */
-  function testRelationshipTypeDeleteWithoutRequired() {
+  public function testRelationshipTypeDeleteWithoutRequired() {
     $params = array(
       'name_b_a' => 'Relation 2 delete without required',
       'contact_type_b' => 'Individual',
@@ -167,7 +155,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with incorrect required fields
    */
-  function testRelationshipTypeDeleteWithIncorrectData() {
+  public function testRelationshipTypeDeleteWithIncorrectData() {
     $params = array(
       'id' => 'abcd',
       'name_b_a' => 'Relation 2 delete with incorrect',
@@ -185,11 +173,11 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check relationship type delete
    */
-  function testRelationshipTypeDelete() {
+  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);
@@ -200,7 +188,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with empty array
    */
-  function testRelationshipTypeUpdateEmpty() {
+  public function testRelationshipTypeUpdateEmpty() {
     $params = array();
     $result = $this->callAPIFailure('relationship_type', 'create', $params);
     $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: name_a_b, name_b_a, contact_type_a, contact_type_b');
@@ -209,7 +197,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with no contact type
    */
-  function testRelationshipTypeUpdateWithoutContactType() {
+  public function testRelationshipTypeUpdateWithoutContactType() {
     // create sample relationship type.
     $this->_relTypeID = $this->_relationshipTypeCreate();
 
@@ -231,7 +219,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with all parameters
    */
-  function testRelationshipTypeUpdate() {
+  public function testRelationshipTypeUpdate() {
     // create sample relationship type.
     $this->_relTypeID = $this->_relationshipTypeCreate();
 
@@ -258,7 +246,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with empty array
    */
-  function testRelationshipTypesGetEmptyParams() {
+  public function testRelationshipTypesGetEmptyParams() {
     $firstRelTypeParams = array(
       'name_a_b' => 'Relation 27 for create',
       'name_b_a' => 'Relation 28 for create',
@@ -289,7 +277,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with params Not Array.
    */
-  function testRelationshipTypesGetParamsNotArray() {
+  public function testRelationshipTypesGetParamsNotArray() {
 
     $results = $this->callAPIFailure('relationship_type', 'get', 'string');
   }
@@ -297,7 +285,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
   /**
    * Check with valid params array.
    */
-  function testRelationshipTypesGet() {
+  public function testRelationshipTypesGet() {
     $firstRelTypeParams = array(
       'name_a_b' => 'Relation 30 for create',
       'name_b_a' => 'Relation 31 for create',
@@ -334,8 +322,10 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
 
   /**
    * Create relationship type.
+   * @param null $params
+   * @return mixed
    */
-  function _relationshipTypeCreate($params = NULL) {
+  public function _relationshipTypeCreate($params = NULL) {
     if (!is_array($params) || empty($params)) {
       $params = array(
         'name_a_b' => 'Relation 1 for create',
@@ -351,4 +341,3 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
     return $this->relationshipTypeCreate($params);
   }
 }
-