Skip to content

Commit

Permalink
add collection wrapping for BatchFake (#47589)
Browse files Browse the repository at this point in the history
  • Loading branch information
schonhoff authored Jun 27, 2023
1 parent aa18c13 commit 9e6cb65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Illuminate/Support/Testing/Fakes/BatchFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Bus\Batch;
use Illuminate\Bus\UpdatedBatchJobCounts;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;

class BatchFake extends Batch
{
Expand Down Expand Up @@ -79,6 +80,8 @@ public function fresh()
*/
public function add($jobs)
{
$jobs = Collection::wrap($jobs);

foreach ($jobs as $job) {
$this->added[] = $job;
}
Expand Down

0 comments on commit 9e6cb65

Please sign in to comment.