summaryrefslogtreecommitdiff
path: root/tests/Framework/ImapGeneric.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-07-04 08:45:41 +0200
committerAleksander Machniak <alec@alec.pl>2013-07-04 08:48:03 +0200
commit88e49b37f71f1a69e88952e8938cb5c6cb19630f (patch)
tree1b36fe704dfde0716e88d5247a1a556b1763cbce /tests/Framework/ImapGeneric.php
parent440b58b476e723053d24e3e39803b64bc7fec115 (diff)
Fix parsing of square bracket characters in IMAP response strings (#1489223)
Conflicts: program/lib/Roundcube/rcube_imap_generic.php
Diffstat (limited to 'tests/Framework/ImapGeneric.php')
-rw-r--r--tests/Framework/ImapGeneric.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Framework/ImapGeneric.php b/tests/Framework/ImapGeneric.php
index 2f9b6d10f..af73158e5 100644
--- a/tests/Framework/ImapGeneric.php
+++ b/tests/Framework/ImapGeneric.php
@@ -35,4 +35,27 @@ class Framework_ImapGeneric extends PHPUnit_Framework_TestCase
$this->assertSame(array(1, 2, 3), $result);
$this->assertCount(3, $result);
}
+
+ /**
+ * Test for tokenizeResponse
+ */
+ function test_tokenizeResponse()
+ {
+ $response = "test brack[et] {1}\r\na {0}\r\n (item1 item2)";
+
+ $result = rcube_imap_generic::tokenizeResponse($response, 1);
+ $this->assertSame("test", $result);
+
+ $result = rcube_imap_generic::tokenizeResponse($response, 1);
+ $this->assertSame("brack[et]", $result);
+
+ $result = rcube_imap_generic::tokenizeResponse($response, 1);
+ $this->assertSame("a", $result);
+
+ $result = rcube_imap_generic::tokenizeResponse($response, 1);
+ $this->assertSame("", $result);
+
+ $result = rcube_imap_generic::tokenizeResponse($response, 1);
+ $this->assertSame(array('item1', 'item2'), $result);
+ }
}