diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-07-04 08:45:41 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-07-04 08:48:03 +0200 |
commit | 88e49b37f71f1a69e88952e8938cb5c6cb19630f (patch) | |
tree | 1b36fe704dfde0716e88d5247a1a556b1763cbce /tests/Framework | |
parent | 440b58b476e723053d24e3e39803b64bc7fec115 (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')
-rw-r--r-- | tests/Framework/ImapGeneric.php | 23 |
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); + } } |