You are here

public function IntervalTest::subtractionDateProvider in Commerce Core 8.2

Data provider for ::testSubtraction.

Return value

array A list of testSubtraction function arguments.

File

tests/src/Kernel/IntervalTest.php, line 131

Class

IntervalTest
Tests the Interval class.

Namespace

Drupal\Tests\commerce\Kernel

Code

public function subtractionDateProvider() {
  return [
    [
      '2017-02-24 17:15',
      new Interval('1', 'hour'),
      '2017-02-24 16:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('18', 'hour'),
      '2017-02-23 23:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('1', 'day'),
      '2017-02-23 17:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('30', 'day'),
      '2017-01-25 17:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('1', 'week'),
      '2017-02-17 17:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('4', 'week'),
      '2017-01-27 17:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('1', 'month'),
      '2017-01-24 17:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('2', 'month'),
      '2016-12-24 17:15',
    ],
    [
      '2017-03-31 17:15',
      new Interval('1', 'month'),
      '2017-02-28 17:15',
    ],
    [
      '2017-02-28 17:15',
      new Interval('1', 'month'),
      '2017-01-28 17:15',
    ],
    [
      '2017-03-31 17:15',
      new Interval('4', 'month'),
      '2016-11-30 17:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('1', 'year'),
      '2016-02-24 17:15',
    ],
    [
      '2017-02-24 17:15',
      new Interval('2', 'year'),
      '2015-02-24 17:15',
    ],
  ];
}