public function testClosedSocketNewlineToken() { $protocol = new Protocol\Imap($this->_params['host']); $protocol->login($this->_params['user'], $this->_params['password']); $protocol->logout(); try { $protocol->select("foo\nbar"); } catch (\Exception $e) { return; // ok } $this->fail('no exception while using procol with closed socket'); }
/** * Close resource for mail lib. If you need to control, when the resource * is closed. Otherwise the destructor would call this. * * @return null */ public function close() { $this->_currentFolder = ''; $this->_protocol->logout(); }
public function testClosedSocketNewlineToken() { $protocol = new Protocol\Imap($this->_params['host']); $protocol->login($this->_params['user'], $this->_params['password']); $protocol->logout(); $this->setExpectedException('Zend\\Mail\\Storage\\Exception\\InvalidArgumentException'); $protocol->select("foo\nbar"); }