File tree 2 files changed +23
-0
lines changed
src/Illuminate/Foundation/Bus
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,18 @@ public function delay($delay)
100
100
return $ this ;
101
101
}
102
102
103
+ /**
104
+ * Set the delay for the job to zero seconds.
105
+ *
106
+ * @return $this
107
+ */
108
+ public function withoutDelay ()
109
+ {
110
+ $ this ->job ->withoutDelay ();
111
+
112
+ return $ this ;
113
+ }
114
+
103
115
/**
104
116
* Indicate that the job should be dispatched after all database transactions have committed.
105
117
*
Original file line number Diff line number Diff line change @@ -30,6 +30,17 @@ public function test_queue_without_delay()
30
30
31
31
$ this ->assertEquals (0 , $ job ->delay );
32
32
}
33
+
34
+ public function test_pending_dispatch_without_delay ()
35
+ {
36
+ Queue::fake ();
37
+
38
+ $ job = new TestJob ;
39
+
40
+ dispatch ($ job )->withoutDelay ();
41
+
42
+ $ this ->assertEquals (0 , $ job ->delay );
43
+ }
33
44
}
34
45
35
46
class TestJob implements ShouldQueue
You can’t perform that action at this time.
0 commit comments