public function noop() { if ($this->state != self::STATE_NOT_AUTHENTICATED && $this->state != self::STATE_AUTHENTICATED && $this->state != self::STATE_SELECTED && $this->state != self::STATE_SELECTED_READONLY) { throw new ezcMailTransportException("Can not issue NOOP command if not connected."); } $tag = $this->getNextTag(); $this->connection->sendData("{$tag} NOOP"); $response = trim($this->getResponse($tag)); if ($this->responseType($response) != self::RESPONSE_OK) { throw new ezcMailTransportException("NOOP failed: {$response}."); } }
public function testNoopNotConnected() { $imap = new ezcMailImapTransport(self::$server, self::$port); $imap->disconnect(); try { $imap->noop(); $this->fail("Expected exception was not thrown."); } catch (ezcMailTransportException $e) { } }