/**
  * Test if we can use first_attempt_delay to set a delay of the first attempt.
  */
 public function testNewJobsCanBeDelayedWithFirstAttemptExecutedNow()
 {
     $inc_job_with_no_first_attempt_delay = new Inc(['number' => 123, 'delay' => 5, 'first_attempt_delay' => 0]);
     $this->assertEquals(5, $inc_job_with_no_first_attempt_delay->getDelay());
     $this->assertEquals(0, $inc_job_with_no_first_attempt_delay->getFirstJobDelay());
     $this->assertEquals(1, $this->dispatcher->dispatch($inc_job_with_no_first_attempt_delay));
     /** @var DateTime $available_at */
     $available_at = $this->connection->executeFirstCell('SELECT `available_at` FROM `' . MySqlQueue::JOBS_TABLE_NAME . '` WHERE `id` = ?', 1);
     $this->assertInstanceOf('DateTime', $available_at);
     $this->assertLessThanOrEqual(time(), $available_at->getTimestamp());
 }
 /**
  * Test delay is set using delay data property.
  */
 public function testDelayIsSetUsingData()
 {
     $job = new Inc(['number' => 123, 'delay' => 15]);
     $this->assertEquals(15, $job->getDelay());
 }