for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AcMailerTest\Event;
use AcMailer\Event\AbstractMailListener;
use AcMailer\Event\MailEvent;
/**
* Class MailListenerMock
* @author Alejandro Celaya Alastrué
* @link http://www.alejandrocelaya.com
*/
class MailListenerMock extends AbstractMailListener
{
private $onPreSendCalled = false;
private $onPostSendCalled = false;
private $onSendErrorCalled = false;
* Called before sending the email
* @param MailEvent $e
* @return mixed
public function onPreSend(MailEvent $e)
$this->onPreSendCalled = true;
}
* Called after sending the email
public function onPostSend(MailEvent $e)
$this->onPostSendCalled = true;
* Called if an error occurs while sending the email
public function onSendError(MailEvent $e)
$this->onSendErrorCalled = true;
* @return bool
public function isOnPreSendCalled()
return $this->onPreSendCalled;
public function isOnPostSendCalled()
return $this->onPostSendCalled;
public function isOnSendErrorCalled()
return $this->onSendErrorCalled;