public function testFindPendingJobInRestrictedQueue()
 {
     $this->assertNull($this->repo->findPendingJob());
     $a = new Job('a');
     $b = new Job('b', array(), true, 'other_queue');
     $this->em->persist($a);
     $this->em->persist($b);
     $this->em->flush();
     $this->assertSame($a, $this->repo->findPendingJob());
     $this->assertSame($b, $this->repo->findPendingJob(array(), array(), array('other_queue')));
 }
 public function testFindPendingJob()
 {
     $this->assertNull($this->repo->findPendingJob());
     $a = new Job('a');
     $a->setState('running');
     $b = new Job('b');
     $this->em->persist($a);
     $this->em->persist($b);
     $this->em->flush();
     $this->assertSame($b, $this->repo->findPendingJob());
     $this->assertNull($this->repo->findPendingJob(array($b->getId())));
 }