/** * @param mixed $file * @dataProvider providerAttach * @depends testClearAttachments */ public function testAttach($file) { $this->mail->clearAttachments(); $this->mail->attach($file); $this->assertNotEmpty($this->mail->files); $this->mail->clearAttachments(); }
/** * Attaches a file to the mailer. * * @param mixed $file The file to attach * @param string $name The name of the file to attach as * @param string $encoding The encoding of the attachment * @param string $type The header type of the attachment */ public function attach($file, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { parent::attach($file); $this->mailer->AddAttachment($file, $name, $encoding, $type); }