/** * Class destructor to ensure all open connections are closed * * @return void */ public function __destruct() { if ($this->_connection instanceof Zend_Mail_Protocol_Smtp) { $this->_connection->quit(); $this->_connection->disconnect(); } }
/** * @depends testEhlo */ public function testQuit() { $p = $this->_protocol; $expectedDialog = $this->_connectAndEhlo(); $expectedDialog[] = 'QUIT'; $expectedDialog[] = $p->responseBuffer[] = '221 goodbye'; $this->_protocol->quit(); $this->assertEquals($expectedDialog, $this->_protocol->dialog); }
/** * Class destructor to ensure all open connections are closed * * @return void */ public function __destruct() { if ($this->_connection instanceof Zend_Mail_Protocol_Smtp) { try { $this->_connection->quit(); } catch (Zend_Mail_Protocol_Exception $e) { // ignore } $this->_connection->disconnect(); } }