You are here

function RulesUnitTest::testIntervals2MinuteRange in Ultimate Cron 8.2

File

tests/src/Unit/RulesUnitTest.php, line 50

Class

RulesUnitTest
Tests Drupal\ultimate_cron\CronRule.

Namespace

Drupal\Tests\ultimate_cron\Unit

Code

function testIntervals2MinuteRange() {
  $intervals = $this
    ->getIntervals('10-11 12 * * *');
  $this
    ->assertEquals(range(11, 10, -1), $intervals['minutes'], 'Expected minutes to be 10, 11');
  $intervals = $this
    ->getIntervals('0-1 12 * * *');
  $this
    ->assertEquals(range(1, 0, -1), $intervals['minutes'], 'Expected minutes to be 0, 1');
  $intervals = $this
    ->getIntervals('58-59 12 * * *');
  $this
    ->assertEquals(range(59, 58, -1), $intervals['minutes'], 'Expected minutes to be 58, 59');
}