_params = array('host' => TESTS_ZEND_MAIL_SMTP_HOST, 'port' => TESTS_ZEND_MAIL_SMTP_PORT, 'username' => TESTS_ZEND_MAIL_SMTP_USER, 'password' => TESTS_ZEND_MAIL_SMTP_PASSWORD, 'auth' => TESTS_ZEND_MAIL_SMTP_AUTH); } /** * @group ZF-8988 */ public function testReturnPathIsUsedAsMailFrom() { $connectionMock = $this->getMock('Zend_Mail_Protocol_Smtp'); $connectionMock->expects($this->once()) ->method('mail') ->with('return@example.com'); $transport = new Zend_Mail_Transport_Smtp($this->_params['host'], $this->_params); $transport->setConnection($connectionMock); $mail = new Zend_Mail(); $mail->setBodyText('This is a test.') ->setFrom('from@example.com', 'from user') ->setReturnPath('return@example.com'); $mail->send($transport); } }