/** * @return void */ public function testSendMailContainsAttachments() { $textFilePath = __DIR__ . '/testfile.txt'; $this->inclusionHandler->expects($this->any())->method('encodeBase64')->will($this->returnValueMap([[$textFilePath, 'VGVzdCBGaWxlIENvbnRlbnQ=']])); $this->inclusionHandler->expects($this->any())->method('guessType')->will($this->returnValueMap([[$textFilePath, 'text/plain']])); $mailTransfer = new MailTransfer(); $mailTransfer->addAttachment((new AttachmentTransfer())->setDisplayName('ATestfile')->setFileName($textFilePath)); $this->mandrillMock->messages->expects($this->once())->method('sendTemplate')->with($this->anything(), $this->anything(), $this->arrayContainsKeyEqualTo('attachments', [['type' => 'text/plain', 'name' => 'ATestfile', 'content' => 'VGVzdCBGaWxlIENvbnRlbnQ=']]), $this->anything(), $this->anything(), $this->anything()); $this->mailSender->sendMail($mailTransfer); }