You are here

function UltimateCronRulesUnitTestCase::testRules5MinuteStep in Ultimate Cron 7.2

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

File

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

Class

UltimateCronRulesUnitTestCase
@file

Code

function testRules5MinuteStep() {

  // Test a 5 minute step
  $result = $this
    ->runTest(array(
    'result' => FALSE,
    'rules' => '*/5 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:01:00',
  ));
  $this
    ->assertTRUE($result[0], $result[1]);
  $result = $this
    ->runTest(array(
    'result' => FALSE,
    'rules' => '*/5 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:02:00',
  ));
  $this
    ->assertTRUE($result[0], $result[1]);
  $result = $this
    ->runTest(array(
    'result' => FALSE,
    'rules' => '*/5 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:03:00',
  ));
  $this
    ->assertTRUE($result[0], $result[1]);
  $result = $this
    ->runTest(array(
    'result' => FALSE,
    'rules' => '*/5 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:04:00',
  ));
  $this
    ->assertTRUE($result[0], $result[1]);
  $result = $this
    ->runTest(array(
    'result' => TRUE,
    'rules' => '*/5 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:05:00',
  ));
  $this
    ->assertTRUE($result[0], $result[1]);
}