Skip to content

Instantly share code, notes, and snippets.

@jarektkaczyk
Created May 19, 2020 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarektkaczyk/3b18e2445f45d604bddde8cd405e1eab to your computer and use it in GitHub Desktop.
Save jarektkaczyk/3b18e2445f45d604bddde8cd405e1eab to your computer and use it in GitHub Desktop.
Dispatchable incompatible with queue assertions?
<?php
// Laravel 7.*
// Testing jobs:
Queue::later(now()->addMinute(), new SomeJob);
Queue::assertPushed(SomeJob::class, fn () => ...); // works
SomeJob::dispatch()->delay(now()->addMinute());
Queue::assertPushed(SomeJob::class, fn () => ...); // Doesn't work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment