Beispiel #1
0
 /**
  * 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 Exception\RuntimeException('cannot change folder, maybe it does not exist');
     }
 }
Beispiel #2
0
 public function testStore()
 {
     $protocol = new 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]));
 }