public function testTooLateCount() { $mail = new Zend_Mail_Storage_Imap($this->_params); $mail->close(); // after closing we can't count messages try { $mail->countMessages(); } catch (Exception $e) { return; // test ok } $this->fail('no exception raised while counting messages on closed connection'); }