Author: Chris Corbyn
Inheritance: implements Swift_Transport
 public function testRecoverLoadbalancedTransportWithSpool()
 {
     $realTransport = $this->getMockBuilder('Swift_Transport')->getMock();
     $spool = $this->getMockBuilder('Swift_Spool')->getMock();
     $spool->expects($this->once())->method('flushQueue')->with($realTransport)->will($this->returnValue(7));
     $spoolTransport = new \Swift_Transport_SpoolTransport(new \Swift_Events_SimpleEventDispatcher(), $spool);
     $loadBalancedTransport = new \Swift_Transport_LoadBalancedTransport();
     $loadBalancedTransport->setTransports(array($spoolTransport));
     $container = $this->buildContainer($loadBalancedTransport, $realTransport);
     $tester = $this->executeCommand($container);
     $this->assertStringEndsWith("7 emails sent\n", $tester->getDisplay());
 }
 private function getTransport(array $transports)
 {
     $transport = new Swift_Transport_LoadBalancedTransport();
     $transport->setTransports($transports);
     return $transport;
 }
Ejemplo n.º 3
0
 protected function _killCurrentTransport()
 {
     $this->_currentTransport = null;
     parent::_killCurrentTransport();
 }