Skip to content

Commit

Permalink
Update BusFake to use new BatchFake (laravel#44173)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmccreary authored Sep 16, 2022
1 parent ce12bc0 commit 6299cd8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

use Carbon\CarbonImmutable;
use Closure;
use Illuminate\Bus\Batch;
use Illuminate\Bus\BatchRepository;
use Illuminate\Bus\PendingBatch;
use Illuminate\Bus\UpdatedBatchJobCounts;
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Str;

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

$this->batches[$id] = new Batch(
new QueueFake(Facade::getFacadeApplication()),
$this,
$this->batches[$id] = new BatchFake(
$id,
$batch->name,
count($batch->jobs),
Expand Down Expand Up @@ -129,7 +125,7 @@ public function markAsFinished(string $batchId)
public function cancel(string $batchId)
{
if (isset($this->batches[$batchId])) {
$this->batches[$batchId]->cancelledAt = now();
$this->batches[$batchId]->cancel();
}
}

Expand Down

0 comments on commit 6299cd8

Please sign in to comment.