public function testReturnPath()
{
$mail = new Zend_Mail();
$res = $mail->setBodyText('This is a test.');
$mail->setFrom('*****@*****.**', 'test Mail User');
$mail->setSubject('My Subject');
$mail->addTo('*****@*****.**');
$mail->addTo('*****@*****.**');
$mail->addBcc('*****@*****.**');
$mail->addBcc('*****@*****.**');
$mail->addCc('*****@*****.**', 'Example no. 1 for cc');
$mail->addCc('*****@*****.**', 'Example no. 2 for cc');
// First example: from and return-path should be equal
$mock = new Zend_Mail_Transport_Mock();
$mail->send($mock);
$this->assertTrue($mock->called);
$this->assertEquals($mail->getFrom(), $mock->returnPath);
// Second example: from and return-path should not be equal
$mail->setReturnPath('*****@*****.**');
$mock = new Zend_Mail_Transport_Mock();
$mail->send($mock);
$this->assertTrue($mock->called);
$this->assertNotEquals($mail->getFrom(), $mock->returnPath);
$this->assertEquals($mail->getReturnPath(), $mock->returnPath);
$this->assertNotEquals($mock->returnPath, $mock->from);
}