public function testSetAttachmentsWithCustomFilename() { $email = new Email(); $array_of_attachments = array("customName.txt" => "path/to/file/file_1.txt", 'another_name_|.txt' => "../file_2.txt", 'custom_name_2.zip' => "../file_3.txt"); $email->setAttachments($array_of_attachments); $attachments = $email->getAttachments(); $this->assertEquals($attachments[0]['custom_filename'], 'customName.txt'); $this->assertEquals($attachments[1]['custom_filename'], 'another_name_|.txt'); $this->assertEquals($attachments[2]['custom_filename'], 'custom_name_2.zip'); }