BatchFake.php
1 month ago
BatchRepositoryFake.php
1 month ago
BusFake.php
1 month ago
EventFake.php
1 month ago
MailFake.php
1 month ago
NotificationFake.php
1 month ago
PendingBatchFake.php
1 month ago
PendingChainFake.php
2 years ago
PendingMailFake.php
2 years ago
QueueFake.php
1 month ago
PendingBatchFake.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Support\Testing\Fakes; |
| 4 | |
| 5 | use IAWPSCOPED\Illuminate\Bus\PendingBatch; |
| 6 | use IAWPSCOPED\Illuminate\Support\Collection; |
| 7 | /** @internal */ |
| 8 | class PendingBatchFake extends PendingBatch |
| 9 | { |
| 10 | /** |
| 11 | * The fake bus instance. |
| 12 | * |
| 13 | * @var \Illuminate\Support\Testing\Fakes\BusFake |
| 14 | */ |
| 15 | protected $bus; |
| 16 | /** |
| 17 | * Create a new pending batch instance. |
| 18 | * |
| 19 | * @param \Illuminate\Support\Testing\Fakes\BusFake $bus |
| 20 | * @param \Illuminate\Support\Collection $jobs |
| 21 | * @return void |
| 22 | */ |
| 23 | public function __construct(BusFake $bus, Collection $jobs) |
| 24 | { |
| 25 | $this->bus = $bus; |
| 26 | $this->jobs = $jobs; |
| 27 | } |
| 28 | /** |
| 29 | * Dispatch the batch. |
| 30 | * |
| 31 | * @return \Illuminate\Bus\Batch |
| 32 | */ |
| 33 | public function dispatch() |
| 34 | { |
| 35 | return $this->bus->recordPendingBatch($this); |
| 36 | } |
| 37 | /** |
| 38 | * Dispatch the batch after the response is sent to the browser. |
| 39 | * |
| 40 | * @return \Illuminate\Bus\Batch |
| 41 | */ |
| 42 | public function dispatchAfterResponse() |
| 43 | { |
| 44 | return $this->bus->recordPendingBatch($this); |
| 45 | } |
| 46 | } |
| 47 |