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:----OnXa1l4/0rxJOtFQTMJITlZhpmAr3/7bTXquVaRfZOIy9Bflxuu8Oi7y6JYsEt3/+HJpgYhcI1LPuMPLNWWtcTEgpt9HS85AFdvddARhe+xzKztYLPIU9v4bu+npNcJ5EnbvjN1aZJucaijZJzy8yEFepCZ2+KhJrbaPhMILMCwZQO/GwF90Do4ySau5ju5dnNs+PrXyeQly9/TBwNI536/Dz8u0+h0/4Ti6hEkFjvKnMjih14cISjTnwUVvSP+d4wXdzkeMJWkiFE0A/QwTtWRXwTjy8VTNlvpBmZJwY8sXk2wN8rlI7NBOMovU77YkL2B8j5Fy1sLnr3wnpCinci/KKc1vymWm8SFw8DNflPRVg1OLpXFiwPNM3t85mTbKHwVBOcB255WmjKqOYqe7mcZQfAIBYfnse+63z63MMH9TrOZxSFUi1Nxz7/fsJIPjLKY2KLrVXTW7Iu+S1gbEvRJzqR29lrcRtMFigolP8I9uz/2SGTTj52qc0yiDEysszTZcVW+lUVAEQyOP63JwWcZW0+W/pGrxHWfkN/oXP+T8By6OsAPccG2VOVS5C9vltr/XJkHDEw+HDl9j/QP5Q+9ZPBbGUT13fzaUiOChSp8iaqKsWM8xkk8c7GK7Yzb6+JOK+U7uuE9xDTEgcuVOGXVBGc5fn2IcPWC3RokAajY=----ATTACHMENT:----NDkyNzYxMjY2NDgyMDg0NCA5NDgxNzkwNTY5MTAwMDI1IDc4OTEyMzU2MTE2MTQ4NjQ=