function DateRestrictionsHostEntityMinMaxTestCase::setUp in Date Restrictions 7
Creates a field for each date field type.
Overrides DateRestrictionsBase::setUp
File
- modules/
minmax/ tests/ date_restrictions_minmax_host_entity.test, line 20 - Tests for date_restrictions_minmax.module.
Class
- DateRestrictionsHostEntityMinMaxTestCase
- Tests for host_entity based relative/fixed minmax restrictions.
Code
function setUp() {
$modules = array(
'date_restrictions_host_entity',
'date_restrictions_minmax',
'date',
'interval',
);
parent::setUp($modules);
// Create date field. We will use it as host_entity source.
// TODO: For completeness we should test also datetime, datestamp and
// all widget types.
$field_name = 'field_host_entity_date';
$options = array(
'label' => $field_name,
'field_name' => $field_name,
'field_type' => 'date',
'input_format' => $this->date_input_format,
'tz_handling' => $this->date_tz_handling,
'widget_type' => 'date_popup',
);
$this
->createDateField($options);
// Create interval field. We will use it as host_entity source.
$field_name = 'field_host_entity_interval';
$options = array(
'label' => $field_name,
'field_name' => $field_name,
);
$this
->createIntervalField($options);
}