You are here

function RulesUnitTest::testRules5MinuteStep in Ultimate Cron 8.2

File

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

Class

RulesUnitTest
Tests Drupal\ultimate_cron\CronRule.

Namespace

Drupal\Tests\ultimate_cron\Unit

Code

function testRules5MinuteStep() {

  // Test a 5 minute step
  $result = $this
    ->assertRule(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
    ->assertRule(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
    ->assertRule(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
    ->assertRule(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
    ->assertRule(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]);
}