/**
  * Create the mail.
  *
  * @param bool $withLayout
  * @param bool $withTranslation
  * @param bool $withTranslationDomain
  *
  * @return Mail
  */
 protected function createMail($withLayout = false, $withTranslation = false, $withTranslationDomain = false)
 {
     $mail = new Mail();
     $mail->setType(MailTypes::TYPE_ALL)->setSubject('Subject of template')->setHtmlBody('HTML Body of template')->setBody('Body of template')->setName('test')->setLabel('Test')->setDescription('Description of template')->setEnabled(true)->setTranslationDomain($withTranslationDomain ? 'domain' : null);
     if ($withLayout) {
         $mail->setLayout($this->createLayout($withTranslation, $withTranslationDomain));
     }
     if ($withTranslation && !$withTranslationDomain) {
         $translation = new MailTranslation($mail);
         $translation->setSubject('Subject of translation')->setHtmlBody('HTML body of translation')->setLocale('fr')->setLabel('Label of translation')->setDescription('Description of translation')->setBody('Body of translation');
     }
     return $mail;
 }
 /**
  * Get the mail and translation models.
  *
  * @param string $locale The locale
  *
  * @return array The mail and translation
  */
 protected function getModels($locale)
 {
     $mail = new Mail();
     $mail->setName('test')->setLabel('Label of template')->setDescription('Description of template')->setSubject('Subject of template')->setHtmlBody('HTML Body of template')->setBody('Body of template');
     $translation = new MailTranslation($mail);
     $translation->setSubject('Subject of translated template')->setHtmlBody('HTML Body of translated template')->setSubject('Subject of template')->setHtmlBody('HTML Body of template')->setLocale($locale)->setLabel('Label of translated template')->setDescription('Description of translated template')->setBody('Body of translated template');
     return array($mail, $translation);
 }