function it_throws_exception_when_serializer_is_not_a_normalizer(JobExecution $jobExecution, SerializerInterface $nonNormalizeSerializer, $exportExecution, $cleanExecution)
 {
     $this->setSerializer($nonNormalizeSerializer);
     $jobExecution->getStepExecutions()->willReturn([$exportExecution, $cleanExecution]);
     $jobExecution->getFailureExceptions()->willReturn([]);
     $jobExecution->getLabel()->willReturn('My Job');
     $this->shouldThrow(new \RuntimeException('Cannot normalize job execution of "My Job" because injected serializer is not a normalizer'))->duringNormalize($jobExecution, 'any');
 }
 /**
  * @param JobExecution $jobExecution
  */
 public function __construct(JobExecution $jobExecution)
 {
     $message = '';
     foreach ($jobExecution->getFailureExceptions() as $exception) {
         $message .= $this->getFailureExceptionMessage('JOB', $exception);
     }
     foreach ($jobExecution->getStepExecutions() as $stepExecution) {
         $message .= $this->getStepExecutionMessages($stepExecution);
     }
     parent::__construct($message);
 }