Example #1
0
 /**
  * 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'];
 }
Example #2
0
 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);
 }