Exemplo n.º 1
0
 function it_dequeues_jobs_from_only_matching_queues(QueueRegistryInterface $registry, QueueInterface $queueBaz, QueueInterface $queueFoo, JobInterface $jobFoo)
 {
     $this->beConstructedWith($registry, 'foo');
     $this->getPrefix()->shouldReturn('foo');
     $registry->all()->willReturn([$queueBaz, $queueFoo]);
     $queueBaz->getName()->willReturn('baz');
     $queueFoo->getName()->willReturn('foo');
     $queueBaz->dequeue()->shouldNotBeCalled();
     $queueFoo->dequeue()->shouldBeCalled(1)->willReturn($jobFoo);
     $this->dequeue()->shouldReturn($jobFoo);
 }
 protected function processQueueJobs(QueueInterface $queue)
 {
     while ($job = $queue->dequeue()) {
         $this->executeJob($job);
     }
 }