/** * test move */ public function testMoveMessage() { $message = $this->_sendMessage(); $this->_foldersToClear = array('INBOX', $this->_account->sent_folder, $this->_testFolderName); $inbox = $this->_getFolder('INBOX'); $inboxBefore = $this->_json->updateMessageCache($inbox['id'], 30); // move $testFolder = $this->_getFolder($this->_testFolderName); $result = $this->_json->moveMessages(array(array('field' => 'id', 'operator' => 'in', 'value' => array($message['id']))), $testFolder->getId()); $inboxAfter = $this->_getFolder('INBOX'); // check if count was decreased correctly $this->assertEquals($inboxBefore['cache_unreadcount'] - 1, $inboxAfter['cache_unreadcount']); $this->assertEquals($inboxBefore['cache_totalcount'] - 1, $inboxAfter['cache_totalcount']); $result = $this->_getMessages($this->_testFolderName); $movedMessage = array(); foreach ($result['results'] as $mail) { if ($mail['subject'] == $message['subject']) { $movedMessage = $mail; } } $this->assertTrue(!empty($movedMessage), 'moved message not found'); }