Beispiel #1
0
    public function testMethodSendUsesDefaults()
    {
        Mail\Mail::setDefaultFrom('*****@*****.**', 'John Doe');
        Mail\Mail::setDefaultReplyTo('*****@*****.**','Foo Bar');

        $mail = new Mail\Mail();
        $mail->setBodyText('Defaults Test');

        $mock = new TransportMock();
        $mail->send($mock);
        $headers = $mock->headers;

        $this->assertTrue($mock->called);
        $this->assertEquals($mock->from, '*****@*****.**');
        $this->assertEquals($headers['From'][0], 'John Doe <*****@*****.**>');
        $this->assertEquals($headers['Reply-To'][0], 'Foo Bar <*****@*****.**>');
    }