You are here

public function ScheduleIntervalTest::testManuallySetIntervalDate in Webform Scheduled Tasks 8.2

Test manually setting an interval date.

File

tests/src/Kernel/ScheduleIntervalTest.php, line 106

Class

ScheduleIntervalTest
Test the scheduling intervals.

Namespace

Drupal\Tests\webform_scheduled_tasks\Kernel

Code

public function testManuallySetIntervalDate() {
  Webform::create([
    'id' => 'foo',
  ])
    ->save();
  $scheduled_task = WebformScheduledTask::create([
    'id' => 'foo',
    'result_set_type' => 'all_submissions',
    'task_type' => 'test_task',
    'webform' => 'foo',
    'interval' => [
      'amount' => 1,
      'multiplier' => 86400,
    ],
  ]);
  $scheduled_task
    ->setNextTaskRunDate(10101010);
  $scheduled_task
    ->save();
  $this
    ->assertEquals(10101010, $scheduled_task
    ->getNextTaskRunDate());
}