예제 #1
0
 /**
  * @param array $responses
  *
  * @return \Generated\Shared\Transfer\SendMailResponsesTransfer
  */
 protected function convertResponsesToTransfer($responses)
 {
     $responsesTransfer = new SendMailResponsesTransfer();
     foreach ($responses as $response) {
         $responseTransfer = new SendMailResponseTransfer();
         $responseTransfer->setEmail($response['email']);
         $responseTransfer->setIsSent($response['status'] === self::STATUS_SENT);
         $responseTransfer->setIsQueued($response['status'] === self::STATUS_QUEUED);
         $responseTransfer->setIsRejected($response['status'] === self::STATUS_REJECTED);
         $responseTransfer->setIsInvalid($response['status'] === self::STATUS_INVALID);
         $responseTransfer->setRejectReason($response['reject_reason']);
         $responseTransfer->setIdMessage($response['_id']);
         $responsesTransfer->addResponse($responseTransfer);
     }
     return $responsesTransfer;
 }
예제 #2
0
 /**
  * @return void
  */
 public function testIsMailSentReturnsFalseWhenMailIsInvalid()
 {
     $mockResponses = new SendMailResponsesTransfer();
     $mockResponse = new SendMailResponseTransfer();
     $mockResponse->setEmail('*****@*****.**');
     $mockResponse->setIsInvalid(true);
     $mockResponse->setRejectReason('');
     $mockResponse->setIdMessage('messageId1');
     $mockResponses->addResponse($mockResponse);
     $result = $this->mailSender->isMailSent($mockResponses);
     $this->assertFalse($result);
 }