Skip to content

Commit 6299cd8

Browse files
Update BusFake to use new BatchFake (#44173)
1 parent ce12bc0 commit 6299cd8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
use Carbon\CarbonImmutable;
66
use Closure;
7-
use Illuminate\Bus\Batch;
87
use Illuminate\Bus\BatchRepository;
98
use Illuminate\Bus\PendingBatch;
109
use Illuminate\Bus\UpdatedBatchJobCounts;
11-
use Illuminate\Support\Facades\Facade;
1210
use Illuminate\Support\Str;
1311

1412
class BatchRepositoryFake implements BatchRepository
@@ -53,9 +51,7 @@ public function store(PendingBatch $batch)
5351
{
5452
$id = (string) Str::orderedUuid();
5553

56-
$this->batches[$id] = new Batch(
57-
new QueueFake(Facade::getFacadeApplication()),
58-
$this,
54+
$this->batches[$id] = new BatchFake(
5955
$id,
6056
$batch->name,
6157
count($batch->jobs),
@@ -129,7 +125,7 @@ public function markAsFinished(string $batchId)
129125
public function cancel(string $batchId)
130126
{
131127
if (isset($this->batches[$batchId])) {
132-
$this->batches[$batchId]->cancelledAt = now();
128+
$this->batches[$batchId]->cancel();
133129
}
134130
}
135131

0 commit comments

Comments
 (0)