Ejemplo n.º 1
0
 /**
  * @covers PHPUnit::sendEmail
  */
 public function testSendEmail_BuildsExpectedMessage()
 {
     $subject = "Test mail";
     $body = "Message Body";
     $toAddress = "*****@*****.**";
     $expectedMessage = \Swift_Message::newInstance($subject)->setFrom('*****@*****.**')->setTo($toAddress)->setBody($body);
     /** @var \Swift_Message $actualMail */
     $actualMail = null;
     $this->catchMailPassedToSend($actualMail);
     $this->testedEmailPlugin->sendEmail($toAddress, array(), $subject, $body);
     $this->assertSystemMail($toAddress, '*****@*****.**', $body, $subject, $actualMail);
 }
Ejemplo n.º 2
0
 /**
  * @covers PHPUnit::execute
  */
 public function testMailDeliveryFail()
 {
     $this->loadEmailPluginWithOptions(array('addresses' => array('*****@*****.**')), Build::STATUS_FAILED, false);
     $returnValue = $this->testedEmailPlugin->execute();
     $this->assertEquals(false, $returnValue);
 }