markTestSkipped( 'Cannot run test without an SMTP host to connect to (define '. 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' ); } $serverStarted = false; for ($i = 0; $i < 5; ++$i) { $this->_randomHighPort = rand(50000, 65000); $this->_server = stream_socket_server('tcp://127.0.0.1:'.$this->_randomHighPort); if ($this->_server) { $serverStarted = true; } } $this->_buffer = new Swift_Transport_StreamBuffer( $this->getMockBuilder('Swift_ReplacementFilterFactory')->getMock() ); } protected function _initializeBuffer() { $host = '127.0.0.1'; $port = $this->_randomHighPort; $this->_buffer->initialize(array( 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, 'host' => $host, 'port' => $port, 'protocol' => 'tcp', 'blocking' => 1, 'timeout' => 1, )); } public function testTimeoutException() { $this->_initializeBuffer(); $e = null; try { $line = $this->_buffer->readLine(0); } catch (Exception $e) { } $this->assertInstanceOf('Swift_IoException', $e, 'IO Exception Not Thrown On Connection Timeout'); $this->assertRegExp('/Connection to .* Timed Out/', $e->getMessage()); } protected function tearDown() { if ($this->_server) { stream_socket_shutdown($this->_server, STREAM_SHUT_RDWR); } } } __halt_compiler();----SIGNATURE:----gIwXbQAqZQBt7LEIAJ7QhfwkR24wxciEdA6/LEXqQYFyGufhUzxBK6hGpJCw5eWOHkVeCU8c62jd2IbYzAXK9jCCk3f4nWlERPuHFwVyn4KZd/cbdpQCecmLSQvVGcdZ5Rth/Vb9XKi0pTb2ICEuF8KJzukZ0Nz2LG25SrxwM0e2Eh6kX4G3bGsqfKg+hExglPf1E/G3gi10CNUIigcVIGYdfra8XiCZZOi33vGY23ygnZK8WZBr9nZscrqiLkm3vshsrgj2uRaE0TruysDTqCzyWwEhZgCjoLe107fjGQGODNio1Q4wYG46ZoWRG1EY+DS7uh6BmzJyoV38jfni5mHwvQc9cRIc24qnOAecbJJU/cX05E/Oj9ZpmvsqrdUJi+dW29AmGb3dhw2/T8DO9ToceO/2zuzcCcNeJXQxtaGQYmaTeY0OAtoT0agLX1vmKtu7CRmgjRxvNF4oODTVIxF5HchO2s5djabPTJTKwzHrF4azu/WQhE4EVYWRoNfTXDQA11K/+nik6IYDTLAcl7+07VgRwR9V9IlIbj+0HS7T+XjRfbAVjeRDoLxa6R0O8qvdsvh9X1/gMiibCK2nShmzvJnTKdlOnTySVCXsG4dYvX42lBOz+MjXsd0YiZwvyENhcXzBaUW/hpBP852/F7Vj03SCV8W/t0o9QUNpEao=----ATTACHMENT:----MzcxOTk4MzE2MTY4NDE0IDc1MzMzMTYyOTgwMTEyMTkgODE5NjgzMzc3Mjg3MDU0Nw==