+--------------------------------------------------------------------+
| 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
$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);
$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;
}
* 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));
* It returns NULL
*/
public function testSummary() {
- $formValues = array();
+ $formValues = [];
$obj = new CRM_Contact_Form_Search_Custom_Group($formValues);
$this->assertNull($obj->summary());
}
* 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));
$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()) {
$sql = $obj->contactIDs();
$this->assertTrue(is_string($sql));
$dao = CRM_Core_DAO::executeQuery($sql);
- $contacts = array();
+ $contacts = [];
while ($dao->fetch()) {
$contacts[] = $dao->contact_id;
}