public function setUp() { $this->controller = new Controller(); $this->mailer = $this->getMockBuilder('MailerInterface')->getMockForAbstractClass(); $this->controller->setMailer($this->mailer); }