/** * Count messages all messages in current box * * @return int number of messages * @throws Zend_Mail_Storage_Exception * @throws Zend_Mail_Protocol_Exception */ public function countMessages() { if (!$this->_currentFolder) { throw new Zend_Mail_Storage_Exception('No selected folder to count'); } // TODO: check usage of examine $result = $this->_protocol->examine($this->_currentFolder); return $result['exists']; }
public function testExamine() { $protocol = new Zend_Mail_Protocol_Imap($this->_params['host']); $protocol->login($this->_params['user'], $this->_params['password']); $status = $protocol->examine('INBOX'); $this->assertTrue(is_array($status['flags'])); $this->assertEquals($status['exists'], 6); }