You are here

function UltimateCronRulesUnitTestCase::testIntervals2MinuteRange in Ultimate Cron 7

Same name and namespace in other branches
  1. 6 tests/rules.test \UltimateCronRulesUnitTestCase::testIntervals2MinuteRange()
  2. 7.2 tests/rules.test \UltimateCronRulesUnitTestCase::testIntervals2MinuteRange()

File

tests/rules.test, line 60
Tests for Ultimate Cron's cron parser

Class

UltimateCronRulesUnitTestCase
@file

Code

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