function RulesUnitTest::testIntervals2MinuteRangeWithOffset in Ultimate Cron 8.2
File
- tests/src/Unit/RulesUnitTest.php, line 59
Class
- RulesUnitTest
- Tests Drupal\ultimate_cron\CronRule.
Namespace
Drupal\Tests\ultimate_cron\Unit
Code
function testIntervals2MinuteRangeWithOffset() {
$intervals = $this
->getIntervals('0-1+1 12 * * *');
$this
->assertEquals(range(2, 1, -1), $intervals['minutes'], 'Expected minutes to be 1, 2');
$intervals = $this
->getIntervals('10-11+1 12 * * *');
$this
->assertEquals(range(12, 11, -1), $intervals['minutes'], 'Expected minutes to be 11, 12');
$intervals = $this
->getIntervals('42-43+1 12 * * *');
$this
->assertEquals(array(
44,
43,
), $intervals['minutes'], 'Expected minutes to be 43, 44');
$intervals = $this
->getIntervals('58-59+1 12 * * *');
$this
->assertEquals(array(
59,
0,
), $intervals['minutes'], 'Expected minutes to be 59, 0');
}