diff options
Diffstat (limited to 'tests/Integration/IMAP/MessageMapperTest.php')
-rw-r--r-- | tests/Integration/IMAP/MessageMapperTest.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/Integration/IMAP/MessageMapperTest.php b/tests/Integration/IMAP/MessageMapperTest.php index a4a01bcc2..fa3f2a95f 100644 --- a/tests/Integration/IMAP/MessageMapperTest.php +++ b/tests/Integration/IMAP/MessageMapperTest.php @@ -79,7 +79,7 @@ class MessageMapperTest extends TestCase { // now we tag this message! $client = $this->getClient($account); try { - $imapMessageMapper->addFlag($client, $mailBox, [$newUid], '$label1'); + $imapMessageMapper->addFlag($client, $inbox, [$newUid], '$label1'); } catch (Horde_Imap_Client_Exception $e) { self::fail('Could not tag message'); } finally { @@ -96,7 +96,7 @@ class MessageMapperTest extends TestCase { ); // Let's retrieve the DB to see if we have this tag! - $messages = $messageMapper->findByUids($mailBox, [$newUid]); + $messages = $messageMapper->findByUids($inbox, [$newUid]); $related = $messageMapper->findRelatedData($messages, $account->getUserId()); foreach ($related as $message) { $tags = $message->getTags(); @@ -108,7 +108,7 @@ class MessageMapperTest extends TestCase { // now we untag this message! $client = $this->getClient($account); try { - $imapMessageMapper->removeFlag($client, $mailBox, [$newUid], '$label1'); + $imapMessageMapper->removeFlag($client, $inbox, [$newUid], '$label1'); } catch (Horde_Imap_Client_Exception $e) { self::fail('Could not untag message'); } finally { @@ -124,7 +124,7 @@ class MessageMapperTest extends TestCase { true ); - $messages = $messageMapper->findByUids($mailBox, [$newUid]); + $messages = $messageMapper->findByUids($inbox, [$newUid]); $related = $messageMapper->findRelatedData($messages, $account->getUserId()); foreach ($related as $message) { $tags = $message->getTags(); @@ -171,29 +171,30 @@ class MessageMapperTest extends TestCase { ->finish(); $this->saveMessage($inbox->getName(), $message, $account); + // now we tag this message with $label1 $client = $this->getClient($account); try { // now we tag this message with $label1 - $imapMessageMapper->addFlag($client, $mailBox, [$newUid], '$label1'); + $imapMessageMapper->addFlag($client, $inbox, [$newUid], '$label1'); // now we tag this and the previous message with $label2 - $imapMessageMapper->addFlag($client, $mailBox, [$newUid, $newUid2], '$label2'); + $imapMessageMapper->addFlag($client, $inbox, [$newUid, $newUid2], '$label2'); // test for labels - $tagged = $imapMessageMapper->getFlagged($client, $mailBox, '$label1'); + $tagged = $imapMessageMapper->getFlagged($client, $inbox, '$label1'); self::assertNotEmpty($tagged); // are the counts correct? self::assertCount(1, $tagged); - $tagged = $imapMessageMapper->getFlagged($client, $mailBox, '$label2'); + $tagged = $imapMessageMapper->getFlagged($client, $inbox, '$label2'); self::assertNotEmpty($tagged); self::assertCount(2, $tagged); // test for labels that wasn't set - $tagged = $imapMessageMapper->getFlagged($client, $mailBox, '$notAvailable'); + $tagged = $imapMessageMapper->getFlagged($client, $inbox, '$notAvailable'); self::assertEmpty($tagged); // test for regular flag - recent - $tagged = $imapMessageMapper->getFlagged($client, $mailBox, Horde_Imap_Client::FLAG_RECENT); + $tagged = $imapMessageMapper->getFlagged($client, $inbox, Horde_Imap_Client::FLAG_RECENT); self::assertNotEmpty($tagged); // should return all messages self::assertCount(3, $tagged); |