You are here

public function DateRangeFieldValidationRuleTest::dateInvalidProvider in Field Validation 8

Data provider with invalid dates for each cycle.

Return value

array Returns dataset.

File

tests/src/Kernel/Plugin/FieldValidationRule/DateRangeFieldValidationRuleTest.php, line 256

Class

DateRangeFieldValidationRuleTest
Tests DateRangeFieldValidationRule.

Namespace

Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRule

Code

public function dateInvalidProvider() {
  return [
    'global-upper-border' => [
      'global',
      '2017-01-01 08:30:00',
      '2012-01-01 08:30:00',
      '2016-01-01 08:30:00',
    ],
    'global-lower-border' => [
      'global',
      '2011-01-01 08:30:00',
      '2012-01-01 08:30:00',
      '2018-01-01 08:30:00',
    ],
    'year-upper-border' => [
      'year',
      '2011-09-01 08:30:00',
      '2012-03-01 08:30:00',
      '2018-08-01 08:30:00',
    ],
    'year-lower-border' => [
      'year',
      '2011-02-01 08:30:00',
      '2012-03-01 08:30:00',
      '2018-08-01 08:30:00',
    ],
    'month-upper-border' => [
      'month',
      '2014-07-10 08:30:00',
      '2014-03-01 08:30:00',
      '2014-09-09 08:30:00',
    ],
    'month-lower-border' => [
      'month',
      '2014-04-02 08:30:00',
      '2014-03-03 08:30:00',
      '2018-09-09 08:30:00',
    ],
    'day-upper-border' => [
      'day',
      '2013-01-06 09:30:00',
      '2012-01-07 06:30:00',
      '2018-01-07 08:30:00',
    ],
    'day-lower-border' => [
      'day',
      '2012-01-06 07:30:00',
      '2012-01-05 08:30:00',
      '2018-01-01 09:30:00',
    ],
    'hour-upper-border' => [
      'hour',
      '2013-01-01 08:45:00',
      '2012-01-01 08:30:00',
      '2018-01-01 08:40:00',
    ],
    'hour-lower-border' => [
      'hour',
      '2012-01-01 08:25:00',
      '2012-01-01 08:30:00',
      '2018-01-01 08:40:00',
    ],
    'minute-upper-border' => [
      'minute',
      '2012-01-01 08:30:15',
      '2012-01-01 08:00:00',
      '2018-01-01 08:00:10',
    ],
    'minute-lower-border' => [
      'minute',
      '2012-01-01 08:30:00',
      '2012-01-01 08:30:05',
      '2018-01-01 08:30:06',
    ],
  ];
}