Exemplo n.º 1
0
 /**
  * Adds an error to the list of errors.
  *
  * @param  PHPUnit_Framework_Test $test
  * @param  Exception              $e
  * @param  float                  $time
  */
 public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
 {
     $message = "\n" . $e->getMessage();
     if ($e instanceof PHPUnit_Framework_ExpectationFailedException) {
         /** @var $e PHPUnit_Framework_ExpectationFailedException */
         //$message .= "\n" . $e->getComparisonFailure()->toString();
     }
     $name = $test->getName(false);
     $mail = new Enlight_Components_Mail();
     $mail->addTo($this->mailRecipients);
     $mail->setSubject('PHPUnit test "' . $name . '" failed.');
     $mail->setBodyText($message);
     if ($test instanceof Enlight_Components_Test_Selenium_TestCase && $e instanceof PHPUnit_Framework_ExpectationFailedException && ($screenshot = $test->getFullScreenshot())) {
         $filename = basename($test->getFullScreenshotUrl());
         /** @var $test Enlight_Components_Test_Selenium_TestCase */
         $mail->createAttachment($screenshot, Zend_Mime::TYPE_OCTETSTREAM, Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $filename);
     }
     $mail->send($this->mailTransport);
 }
Exemplo n.º 2
0
 /**
  * Send status mail
  *
  * @param Enlight_Components_Mail $mail
  * @return Enlight_Components_Mail
  */
 public function sendStatusMail(Enlight_Components_Mail $mail)
 {
     $this->eventManager->notify('Shopware_Controllers_Backend_OrderState_Send_BeforeSend', array('subject' => Shopware()->Front(), 'mail' => $mail));
     if (!empty($this->config->OrderStateMailAck)) {
         $mail->addBcc($this->config->OrderStateMailAck);
     }
     return $mail->send();
 }