/** * select given folder * * folder must be selectable! * * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder * @return null * @throws Zend_Mail_Storage_Exception * @throws Zend_Mail_Protocol_Exception */ public function selectFolder($globalName) { $this->_currentFolder = $globalName; if (!$this->_protocol->select($this->_currentFolder)) { $this->_currentFolder = ''; throw new Zend_Mail_Storage_Exception('cannot change folder, maybe it does not exist'); } }
/** * select given folder * * folder must be selectable! * * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder * @return null * @throws Zend_Mail_Storage_Exception * @throws Zend_Mail_Protocol_Exception */ public function selectFolder($globalName) { $this->_currentFolder = $globalName; if (!$this->_protocol->select($this->_currentFolder)) { $this->_currentFolder = ''; /** * @see Zend_Mail_Storage_Exception */ require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception('cannot change folder, maybe it does not exist'); } }
public function testStore() { $protocol = new Zend_Mail_Protocol_Imap($this->_params['host']); $protocol->login($this->_params['user'], $this->_params['password']); $protocol->select('INBOX'); $this->assertTrue($protocol->store(array('\\Flagged'), 1)); $this->assertTrue($protocol->store(array('\\Flagged'), 1, null, '-')); $this->assertTrue($protocol->store(array('\\Flagged'), 1, null, '+')); $result = $protocol->store(array('\\Flagged'), 1, null, '', false); $this->assertTrue(in_array('\\Flagged', $result[1])); $result = $protocol->store(array('\\Flagged'), 1, null, '-', false); $this->assertFalse(in_array('\\Flagged', $result[1])); $result = $protocol->store(array('\\Flagged'), 1, null, '+', false); $this->assertTrue(in_array('\\Flagged', $result[1])); }