public function testOnScheduleWithoutJob() { $event = new SchedulerEvent(new Schedule()); $this->producer->expects($this->never())->method('produce'); $this->subject->onSchedule($event); }
/** * @expectedException \Exception */ public function testAddRethrowsBackendExceptions() { $job = new Job(); $job->setTicket('ticket'); $this->jobManager->expects($this->once())->method('isManagerOf')->with($job)->willReturn(true); $this->registry->expects($this->any())->method('has')->willReturn(true); $this->producer->expects($this->once())->method('produce')->willThrowException(new \Exception()); $this->subject->add($job); }