Merge pull request #13078 from agh1/contactdetail-no-or2
[civicrm-core.git] / tests / phpunit / CRM / Core / BAO / CustomFieldTest.php
index ccb84063d02f066e8865b054e29073c6ccfbfa77..0b97de581618dc9647b857eed5f09db10a4d32d9 100644 (file)
@@ -514,7 +514,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase {
         'import' => 1,
         'custom_field_id' => $this->getCustomFieldID('text'),
         'options_per_line' => NULL,
-        'text_length' => NULL,
+        'text_length' => 300,
         'data_type' => 'String',
         'html_type' => 'Text',
         'is_search_range' => '0',
@@ -537,6 +537,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase {
         'where' => 'civicrm_value_custom_group_' . $customGroupID . '.enter_text_here_' . $this->getCustomFieldID('text'),
         'extends_table' => 'civicrm_contact',
         'search_table' => 'contact_a',
+        'maxlength' => 300,
       ],
       $this->getCustomFieldName('select_string') => [
         'name' => $this->getCustomFieldName('select_string'),
@@ -577,7 +578,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase {
       $this->getCustomFieldName('select_date') => [
         'name' => $this->getCustomFieldName('select_date'),
         'type' => 4,
-        'title' => 'test_date',
+        'title' => 'Test Date',
         'headerPattern' => '//',
         'import' => 1,
         'custom_field_id' => $this->getCustomFieldID('select_date'),
@@ -585,11 +586,11 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase {
         'text_length' => NULL,
         'data_type' => 'Date',
         'html_type' => 'Select Date',
-        'is_search_range' => '0',
+        'is_search_range' => '1',
         'date_format' => 'mm/dd/yy',
         'time_format' => '1',
         'id' => $this->getCustomFieldID('select_date'),
-        'label' => 'test_date',
+        'label' => 'Test Date',
         'groupTitle' => 'Custom Group',
         'default_value' => '20090711',
         'custom_group_id' => $customGroupID,
@@ -638,6 +639,38 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase {
         'extends_table' => 'civicrm_contact',
         'search_table' => 'contact_a',
       ],
+      $this->getCustomFieldName('int') => [
+        'name' => $this->getCustomFieldName('int'),
+        'type' => CRM_Utils_Type::T_INT,
+        'title' => 'Enter integer here',
+        'headerPattern' => '//',
+        'import' => 1,
+        'custom_field_id' => $this->getCustomFieldID('int'),
+        'options_per_line' => NULL,
+        'text_length' => NULL,
+        'data_type' => 'Int',
+        'html_type' => 'Text',
+        'is_search_range' => '1',
+        'id' => $this->getCustomFieldID('int'),
+        'label' => 'Enter integer here',
+        'groupTitle' => 'Custom Group',
+        'default_value' => '4',
+        'custom_group_id' => $customGroupID,
+        'extends' => 'Contact',
+        'extends_entity_column_value' => NULL,
+        'extends_entity_column_id' => NULL,
+        'is_view' => '0',
+        'is_multiple' => '0',
+        'option_group_id' => NULL,
+        'date_format' => NULL,
+        'time_format' => NULL,
+        'is_required' => '1',
+        'table_name' => 'civicrm_value_custom_group_' . $customGroupID,
+        'column_name' => $this->getCustomFieldColumnName('int'),
+        'where' => 'civicrm_value_custom_group_' . $customGroupID . '.' . $this->getCustomFieldColumnName('int'),
+        'extends_table' => 'civicrm_contact',
+        'search_table' => 'contact_a',
+      ],
     ];
     $this->assertEquals($expected, CRM_Core_BAO_CustomField::getFieldsForImport());
   }