public function testSetAttachmentCustomFilename() { $email = new Email(); //Setting an attachment removes all other files $email->setAttachment("only_attachment.sad", "different"); $attachments = $email->getAttachments(); $this->assertEquals(1, count($attachments)); $this->assertEquals($attachments[0]['custom_filename'], 'different'); //Remove an attachment $email->removeAttachment("only_attachment.sad"); $this->assertEquals(0, count($email->getAttachments())); }