Пример #1
0
 public function testSendMinimalMail()
 {
     $headers = new Headers();
     $headers->addHeaderLine('Date', 'Sun, 10 Jun 2012 20:07:24 +0200');
     $message = new Message();
     $message->setHeaders($headers)->setSender('*****@*****.**', 'Ralph Schindler')->setBody('testSendMailWithoutMinimalHeaders')->addTo('*****@*****.**', 'ZF DevTeam');
     $expectedMessage = "RSET\r\n" . "MAIL FROM:<*****@*****.**>\r\n" . "DATA\r\n" . "Date: Sun, 10 Jun 2012 20:07:24 +0200\r\n" . "Sender: Ralph Schindler <*****@*****.**>\r\n" . "To: ZF DevTeam <*****@*****.**>\r\n" . "\r\n" . "testSendMailWithoutMinimalHeaders\r\n" . ".\r\n";
     $this->transport->send($message);
     $this->assertEquals($expectedMessage, $this->connection->getLog());
 }
Пример #2
0
 public function testDisconnect()
 {
     $this->connection->connect();
     $this->assertTrue($this->connection->isConnected());
     $this->transport->disconnect();
     $this->assertFalse($this->connection->isConnected());
 }
Пример #3
0
 public function testDisconnectSendReconnects()
 {
     $this->assertFalse($this->connection->hasSession());
     $this->transport->send($this->getMessage());
     $this->assertTrue($this->connection->hasSession());
     $this->connection->disconnect();
     $this->assertFalse($this->connection->hasSession());
     $this->transport->send($this->getMessage());
     $this->assertTrue($this->connection->hasSession());
 }
Пример #4
0
 public function testDisconnectResetsAuthFlag()
 {
     $this->connection->connect();
     $this->connection->setSessionStatus(true);
     $this->connection->setAuth(true);
     $this->assertTrue($this->connection->getAuth());
     $this->connection->disconnect();
     $this->assertFalse($this->connection->getAuth());
 }
Пример #5
0
 public function testDisconnectCallsQuit()
 {
     $this->connection->disconnect();
     $this->assertTrue($this->connection->calledQuit);
 }