Beispiel #1
0
 public function testAttachContent()
 {
     $message = new Message();
     $fileName = 'test.txt';
     $fileContent = 'Test attachment content';
     $message->attachContent($fileContent, ['fileName' => $fileName]);
     $attachments = $message->getAttachments();
     $this->assertCount(1, $attachments);
     $attachment = $attachments[0];
     $this->assertEquals($attachment['name'], $fileName);
     $this->assertEquals($attachment['data'], base64_encode($fileContent));
     $message->attachContent($fileContent);
     $attachments = $message->getAttachments();
     $this->assertCount(2, $attachments);
     $attachment = $attachments[1];
     $this->assertEquals($attachment['name'], 'file_1');
 }