Exemplo n.º 1
0
    public function testZf928ToAndBccHeadersShouldNotMix()
    {
        $mail = new Mail\Mail();
        $mail->setSubject('my subject');
        $mail->setBodyText('my body');
        $mail->setFrom('*****@*****.**');
        $mail->addTo('*****@*****.**');
        $mail->addBcc('*****@*****.**');
        $mail->addBcc('*****@*****.**');

        // test with generic transport
        $mock = new TransportMock();
        $mail->send($mock);
        $to  = $this->_getHeader($mock);
        $bcc = $this->_getHeader($mock, 'Bcc');
        $this->assertContains('*****@*****.**', $to, $to);
        $this->assertNotContains('*****@*****.**', $to, $bcc);

        // test with sendmail-like transport
        $mock = new SendmailTransportMock();
        $mail->send($mock);
        $to  = $this->_getHeader($mock);
        $bcc = $this->_getHeader($mock, 'Bcc');
        // Remove the following line due to fixes by Simon
        // $this->assertNotContains('*****@*****.**', $to, $mock->header);
        $this->assertNotContains('*****@*****.**', $to, $bcc);
    }