Просмотр файла vendor/illuminate/support/Testing/Fakes/PendingBatchFake.php

Размер файла: 817B
  1. <?php
  2.  
  3. namespace Illuminate\Support\Testing\Fakes;
  4.  
  5. use Illuminate\Bus\PendingBatch;
  6. use Illuminate\Support\Collection;
  7.  
  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. /**
  18. * Create a new pending batch instance.
  19. *
  20. * @param \Illuminate\Support\Testing\Fakes\BusFake $bus
  21. * @param \Illuminate\Support\Collection $jobs
  22. * @return void
  23. */
  24. public function __construct(BusFake $bus, Collection $jobs)
  25. {
  26. $this->bus = $bus;
  27. $this->jobs = $jobs;
  28. }
  29.  
  30. /**
  31. * Dispatch the batch.
  32. *
  33. * @return \Illuminate\Bus\Batch
  34. */
  35. public function dispatch()
  36. {
  37. return $this->bus->recordPendingBatch($this);
  38. }
  39. }