Update copyright date for 2020
[civicrm-core.git] / tests / phpunit / CRM / Contact / Form / Search / Custom / SampleTest.php
index cedcff81e57347d08b888474208ddf9f5914c82c..3c50f16c0af9304ab7eed9c4eb68ab9cfe55b8dc 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019                                |
+ | Copyright CiviCRM LLC (c) 2004-2020                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  * @group headless
  */
 class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
-  protected $_tablesToTruncate = array(
+  protected $_tablesToTruncate = [
     'civicrm_address',
     'civicrm_saved_search',
     'civicrm_contact',
     'civicrm_option_value',
     'civicrm_option_group',
-  );
+  ];
 
   /**
    * @return CRM_Contact_Form_Search_Custom_SamplTestDataProvider
@@ -112,13 +112,13 @@ class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
     $sql = $obj->all(0, 0, 'contact_id');
     $this->assertTrue(is_string($sql));
     $dao = CRM_Core_DAO::executeQuery($sql);
-    $all = array();
+    $all = [];
     while ($dao->fetch()) {
-      $all[] = array(
+      $all[] = [
         'contact_id' => $dao->contact_id,
         'contact_type' => $dao->contact_type,
         'household_name' => $dao->sort_name,
-      );
+      ];
     }
     asort($all);
     $this->assertEquals($full, $all);
@@ -142,7 +142,7 @@ class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
     $sql = $obj->contactIDs();
     $this->assertTrue(is_string($sql));
     $dao = CRM_Core_DAO::executeQuery($sql);
-    $contacts = array();
+    $contacts = [];
     while ($dao->fetch()) {
       $contacts[$dao->contact_id] = 1;
     }
@@ -156,7 +156,7 @@ class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
    *  It returns an array of translated name => keys
    */
   public function testColumns() {
-    $formValues = array();
+    $formValues = [];
     $obj = new CRM_Contact_Form_Search_Custom_Sample($formValues);
     $columns = $obj->columns();
     $this->assertTrue(is_array($columns));
@@ -178,7 +178,7 @@ class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
    *  It returns NULL
    */
   public function testSummary() {
-    $formValues = array();
+    $formValues = [];
     $obj = new CRM_Contact_Form_Search_Custom_Group($formValues);
     $this->assertNull($obj->summary());
   }
@@ -188,7 +188,7 @@ class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
    *  Returns the path to the file as a string
    */
   public function testTemplateFile() {
-    $formValues = array();
+    $formValues = [];
     $obj = new CRM_Contact_Form_Search_Custom_Group($formValues);
     $fileName = $obj->templateFile();
     $this->assertTrue(is_string($fileName));
@@ -205,8 +205,8 @@ class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
 
     $this->loadXMLDataSet(dirname(__FILE__) . '/datasets/sample-dataset.xml');
 
-    $dataset[1] = array('id' => array(12));
-    $dataset[2] = array('id' => array(10, 11));
+    $dataset[1] = ['id' => [12]];
+    $dataset[2] = ['id' => [10, 11]];
 
     $ssdao = CRM_Core_DAO::executeQuery("SELECT * FROM civicrm_saved_search");
     while ($ssdao->fetch()) {
@@ -215,7 +215,7 @@ class CRM_Contact_Form_Search_Custom_SampleTest extends CiviUnitTestCase {
       $sql = $obj->contactIDs();
       $this->assertTrue(is_string($sql));
       $dao = CRM_Core_DAO::executeQuery($sql);
-      $contacts = array();
+      $contacts = [];
       while ($dao->fetch()) {
         $contacts[] = $dao->contact_id;
       }