You are here

function RulesUnitTest::testRules2MinuteRangeWithOffset in Ultimate Cron 8.2

File

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

Class

RulesUnitTest
Tests Drupal\ultimate_cron\CronRule.

Namespace

Drupal\Tests\ultimate_cron\Unit

Code

function testRules2MinuteRangeWithOffset() {

  // Test a 1 minute range
  $result = $this
    ->assertRule(array(
    'result' => FALSE,
    'rules' => '10-11+1 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:10:00',
    'catch_up' => 1,
  ));
  $this
    ->assertTrue($result[0], $result[1]);
  $result = $this
    ->assertRule(array(
    'result' => True,
    'rules' => '10-11+1 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:11:00',
    'catch_up' => 1,
  ));
  $this
    ->assertTrue($result[0], $result[1]);
  $result = $this
    ->assertRule(array(
    'result' => True,
    'rules' => '10-11+1 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:12:00',
    'catch_up' => 1,
  ));
  $this
    ->assertTrue($result[0], $result[1]);
  $result = $this
    ->assertRule(array(
    'result' => FALSE,
    'rules' => '10-11+1 12 * * *',
    'last_run' => '2008-01-03 12:00:00',
    'now' => '2008-01-03 12:13:00',
    'catch_up' => 1,
  ));
  $this
    ->assertTrue($result[0], $result[1]);
}