InteractsWithQueue
trait InteractsWithQueue
Traits
Properties
| Job|null | $job | The underlying queue job instance. |
Methods
Get the number of seconds until the given DateTime.
Get the "available at" UNIX timestamp.
If the given value is an interval, convert it to a DateTime instance.
Given a start time, format the total run time for human readability.
Get the number of times the job has been attempted.
Delete the job from the queue.
Release the job back into the queue after (n) seconds.
Indicate that queue interactions like fail, delete, and release should be faked.
Assert that the job was deleted from the queue.
Assert that the job was not deleted from the queue.
Assert that the job was manually failed.
Assert that the job was manually failed with a specific exception.
Assert that the job was not manually failed.
Assert that the job was released back onto the queue.
Assert that the job was not released back onto the queue.
Details
in
InteractsWithTime at line 17
protected int
secondsUntil(DateInterval|DateTimeInterface|int $delay)
Get the number of seconds until the given DateTime.
in
InteractsWithTime at line 29
protected int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)
Get the "available at" UNIX timestamp.
in
InteractsWithTime at line 41
protected DateTimeInterface|int
parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)
If the given value is an interval, convert it to a DateTime instance.
in
InteractsWithTime at line 57
protected int
currentTime()
Get the current system time as a UNIX timestamp.
in
InteractsWithTime at line 65
protected string
runTimeForHumans(float $startTime, float|null $endTime = null)
Given a start time, format the total run time for human readability.
at line 28
int
attempts()
Get the number of times the job has been attempted.
at line 36
void
delete()
Delete the job from the queue.
at line 47
void
fail(string|Throwable|null $exception = null)
Fail the job from the queue.
at line 61
void
release(DateInterval|DateTimeInterface|int $delay = 0)
Release the job back into the queue after (n) seconds.
at line 74
InteractsWithQueue
withFakeQueueInteractions()
Indicate that queue interactions like fail, delete, and release should be faked.
at line 84
InteractsWithQueue
assertDeleted()
Assert that the job was deleted from the queue.
at line 99
InteractsWithQueue
assertNotDeleted()
Assert that the job was not deleted from the queue.
at line 114
InteractsWithQueue
assertFailed()
Assert that the job was manually failed.
at line 129
InteractsWithQueue
assertFailedWith(string|Throwable $exception)
Assert that the job was manually failed with a specific exception.
at line 171
InteractsWithQueue
assertNotFailed()
Assert that the job was not manually failed.
at line 186
InteractsWithQueue
assertReleased(DateInterval|DateTimeInterface|int|null $delay = null)
Assert that the job was released back onto the queue.
at line 211
InteractsWithQueue
assertNotReleased()
Assert that the job was not released back onto the queue.
at line 236
InteractsWithQueue
setJob(Job $job)
Set the base queue job instance.