You are here

public function FixedReferenceDateIntervalTest::testFixedIntervalPluginProvider in Recurring Time Period 8

Data provider for testSteppedByItem().

File

tests/src/Kernel/FixedReferenceDateIntervalTest.php, line 40

Class

FixedReferenceDateIntervalTest
Tests the fixed interval plugin.

Namespace

Drupal\Tests\recurring_period\Kernel

Code

public function testFixedIntervalPluginProvider() {
  return [
    'annual recurring, due later this year' => [
      // Timezone.
      'Europe/London',
      // Reference date.
      '1970-12-25',
      // Interval.
      [
        'period' => 'year',
        'interval' => 1,
      ],
      // Start date.
      '2017-07-01T00:00:00',
      // Expected end date.
      '2017-12-25T00:00:00',
      // Expected period start date.
      '2016-12-25T00:00:00',
    ],
    'annual recurring, due next year' => [
      'Europe/London',
      '1970-01-01',
      [
        'period' => 'year',
        'interval' => 1,
      ],
      '2017-07-01T00:00:00',
      '2018-01-01T00:00:00',
      '2017-01-01T00:00:00',
    ],
    'annual recurring, entire year left' => [
      'Europe/London',
      '2025-01-01',
      [
        'period' => 'year',
        'interval' => 1,
      ],
      '2017-01-01T00:00:00',
      '2018-01-01T00:00:00',
      '2017-01-01T00:00:00',
    ],
  ];
}