/** * @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); }
/** * @covers PHPUnit::execute */ public function testMailDeliveryFail() { $this->loadEmailPluginWithOptions(array('addresses' => array('*****@*****.**')), Build::STATUS_FAILED, false); $returnValue = $this->testedEmailPlugin->execute(); $this->assertEquals(false, $returnValue); }