File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -638,7 +638,7 @@ protected function getSeconds($ttl)
638
638
*
639
639
* @return string|null
640
640
*/
641
- protected function getName ()
641
+ public function getName ()
642
642
{
643
643
return $ this ->config ['store ' ] ?? null ;
644
644
}
Original file line number Diff line number Diff line change 4
4
5
5
use Exception ;
6
6
use Illuminate \Bus \Queueable ;
7
+ use Illuminate \Container \Container ;
7
8
use Illuminate \Contracts \Cache \Repository as Cache ;
8
9
use Illuminate \Contracts \Queue \ShouldBeUnique ;
9
10
use Illuminate \Contracts \Queue \ShouldBeUniqueUntilProcessing ;
@@ -51,6 +52,14 @@ public function testUniqueJobsAreNotDispatched()
51
52
);
52
53
}
53
54
55
+ public function testUniqueJobWithViaDispatched ()
56
+ {
57
+ Bus::fake ();
58
+
59
+ UniqueViaJob::dispatch ();
60
+ Bus::assertDispatched (UniqueViaJob::class);
61
+ }
62
+
54
63
public function testLockIsReleasedForSuccessfulJobs ()
55
64
{
56
65
UniqueTestJob::$ handled = false ;
@@ -222,3 +231,11 @@ public function __construct(public User $user)
222
231
{
223
232
}
224
233
}
234
+
235
+ class UniqueViaJob extends UniqueTestJob
236
+ {
237
+ public function uniqueVia (): Cache
238
+ {
239
+ return Container::getInstance ()->make (Cache::class);
240
+ }
241
+ }
You can’t perform that action at this time.
0 commit comments