public function DateRangeFieldValidationRuleTest::dateValidProvider in Field Validation 8
Data provider with valid dates for each cycle.
Return value
array Returns dataset.
File
- tests/
src/ Kernel/ Plugin/ FieldValidationRule/ DateRangeFieldValidationRuleTest.php, line 173
Class
- DateRangeFieldValidationRuleTest
- Tests DateRangeFieldValidationRule.
Namespace
Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRuleCode
public function dateValidProvider() {
return [
'global-upper-border' => [
'global',
'2018-01-01 08:30:00',
'2012-01-01 08:30:00',
'2018-01-01 08:30:00',
],
'global-lower-border' => [
'global',
'2012-01-01 08:30:00',
'2012-01-01 08:30:00',
'2018-01-01 08:30:00',
],
'year-upper-border' => [
'year',
'2011-07-01 08:30:00',
'2012-03-01 08:30:00',
'2018-08-01 08:30:00',
],
'year-lower-border' => [
'year',
'2011-04-01 08:30:00',
'2012-03-01 08:30:00',
'2018-08-01 08:30:00',
],
'month-upper-border' => [
'month',
'2014-07-09 08:30:00',
'2014-03-01 08:30:00',
'2014-09-09 08:30:00',
],
'month-lower-border' => [
'month',
'2014-04-03 08:30:00',
'2014-03-03 08:30:00',
'2018-09-09 08:30:00',
],
'day-upper-border' => [
'day',
'2013-01-06 08:30:00',
'2012-01-07 06:30:00',
'2018-01-07 08:30:00',
],
'day-lower-border' => [
'day',
'2012-01-06 08:30:00',
'2012-01-05 08:30:00',
'2018-01-01 09:30:00',
],
'hour-upper-border' => [
'hour',
'2013-01-01 08:40:00',
'2012-01-01 08:30:00',
'2018-01-01 08:40:00',
],
'hour-lower-border' => [
'hour',
'2012-01-01 08:30:00',
'2012-01-01 08:30:00',
'2018-01-01 08:40:00',
],
'minute-upper-border' => [
'minute',
'2012-01-01 08:30:10',
'2012-01-01 08:00:00',
'2018-01-01 08:00:10',
],
'minute-lower-border' => [
'minute',
'2012-01-01 08:30:05',
'2012-01-01 08:30:05',
'2018-01-01 08:30:06',
],
];
}