PendingBatchFake.php 817 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Illuminate\Support\Testing\Fakes;
  3. use Illuminate\Bus\PendingBatch;
  4. use Illuminate\Support\Collection;
  5. class PendingBatchFake extends PendingBatch
  6. {
  7. /**
  8. * The fake bus instance.
  9. *
  10. * @var \Illuminate\Support\Testing\Fakes\BusFake
  11. */
  12. protected $bus;
  13. /**
  14. * Create a new pending batch instance.
  15. *
  16. * @param \Illuminate\Support\Testing\Fakes\BusFake $bus
  17. * @param \Illuminate\Support\Collection $jobs
  18. * @return void
  19. */
  20. public function __construct(BusFake $bus, Collection $jobs)
  21. {
  22. $this->bus = $bus;
  23. $this->jobs = $jobs;
  24. }
  25. /**
  26. * Dispatch the batch.
  27. *
  28. * @return \Illuminate\Bus\Batch
  29. */
  30. public function dispatch()
  31. {
  32. return $this->bus->recordPendingBatch($this);
  33. }
  34. }