function it_executes(JobExecution $jobExecution, JobRepositoryInterface $jobRepository, EventDispatcherInterface $dispatcher, BatchStatus $status) { $this->setEventDispatcher($dispatcher); $this->setJobRepository($jobRepository); $jobExecution->getStatus()->willReturn($status); $status->getValue()->willReturn(BatchStatus::UNKNOWN); $dispatcher->dispatch(EventInterface::BEFORE_JOB_EXECUTION, Argument::any())->shouldBeCalled(); $jobExecution->setStartTime(Argument::any())->shouldBeCalled(); $jobExecution->setStatus(Argument::any())->shouldBeCalled(); $dispatcher->dispatch(EventInterface::AFTER_JOB_EXECUTION, Argument::any())->shouldBeCalled(); $jobExecution->setEndTime(Argument::any())->shouldBeCalled(); $this->execute($jobExecution); }