File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,21 @@ public static function assertPendingBatched(callable $callback)
20
20
$ busFake = app (Dispatcher::class);
21
21
22
22
PHPUnit::assertTrue (
23
- collect ($ busFake -> dispatchedBatches ())
23
+ collect (self :: getDispatchedBatches ())
24
24
->filter (fn ($ batch ) => $ callback (new FluentPendingBatch ($ busFake , $ batch ->jobs )))
25
25
->isNotEmpty (),
26
26
"The expected batch was not dispatched. "
27
27
);
28
28
}
29
+
30
+ /**
31
+ * Get all the batches that have been dispatched.
32
+ *
33
+ * @return array<\Illuminate\Support\Testing\Fakes\PendingBatchFake>
34
+ */
35
+ private static function getDispatchedBatches ()
36
+ {
37
+ /** @phpstan-ignore variable.undefined */
38
+ return (fn () => $ this ->batches )->bindTo (app (Dispatcher::class), BusFake::class)();
39
+ }
29
40
}
You can’t perform that action at this time.
0 commit comments