/**
  * Register an archiver
  *
  * @param ArchiverInterface $archiver
  *
  * @throws \InvalidArgumentException
  */
 public function registerArchiver(ArchiverInterface $archiver)
 {
     if (array_key_exists($archiver->getName(), $this->archivers)) {
         throw new \InvalidArgumentException(sprintf('There is already a registered archiver named "%s": %s', $archiver->getName(), get_class($this->archivers[$archiver->getName()])));
     }
     $this->archivers[$archiver->getName()] = $archiver;
 }
 function it_register_an_event_and_verify_if_job_is_supported(JobExecutionEvent $event, JobExecution $jobExecution, ArchiverInterface $archiver)
 {
     $archiver->getName()->willReturn('output');
     $this->registerArchiver($archiver);
     $event->getJobExecution()->willReturn($jobExecution);
     $archiver->supports($jobExecution)->willReturn(true)->shouldBeCalled();
     $archiver->archive($jobExecution)->shouldBeCalled();
     $this->beforeStatusUpgrade($event);
 }