/** * @test */ public function sendSendsEmail() { $senderAndRecipient = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('John Doe', '*****@*****.**'); $eMail = new Tx_Oelib_Mail(); $eMail->setSender($senderAndRecipient); $eMail->addRecipient($senderAndRecipient); $eMail->setSubject('Hello world!'); $eMail->setMessage('Welcome!'); $this->message->expects(self::once())->method('send'); $this->subject->send($eMail); }
/** * @test */ public function sendCanAddTwoAttachments() { $sender = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('', '*****@*****.**'); $recipient = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('John Doe', $this->email['recipient']); $eMail = new Tx_Oelib_Mail(); $eMail->setSender($sender); $eMail->addRecipient($recipient); $eMail->setSubject($this->email['subject']); $eMail->setMessage($this->email['message']); $attachment1 = new Tx_Oelib_Attachment(); $attachment1->setFileName(t3lib_extMgm::extPath('oelib', 'Tests/Unit/Fixtures/test.txt')); $attachment1->setContentType('text/plain'); $eMail->addAttachment($attachment1); $attachment2 = new Tx_Oelib_Attachment(); $attachment2->setFileName(t3lib_extMgm::extPath('oelib', 'Tests/Unit/Fixtures/test_2.css')); $attachment2->setContentType('text/css'); $eMail->addAttachment($attachment2); $this->subject->send($eMail); $children = $this->subject->getFirstSentEmail()->getChildren(); self::assertSame(2, count($children)); }
/** * @test */ public function hasSenderWithSenderReturnsTrue() { $sender = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('John Doe', '*****@*****.**'); $this->subject->setSender($sender); self::assertTrue($this->subject->hasSender()); }