/** * @testdox Allows setting and getting a \Zend\Mail\Transport\TransportInterface */ public function testSetAndGetTransport() { $target = new MailService(); $transport = $this->getMockForAbstractClass('\\Zend\\Mail\\Transport\\TransportInterface'); $target->setTransport($transport); $this->assertSame($transport, $target->getTransport()); }
public function setup() { $test = $this; $sendCallback = function ($value) use($test) { return $value === $test->expectedMail; }; $transport = $this->getMockForAbstractClass('\\Zend\\Mail\\Transport\\TransportInterface'); $transport->expects($this->once())->method('send')->with($this->callback($sendCallback)); $target = new MailService(new ServiceManager()); $target->setTransport($transport); $this->target = $target; }