From 5383ad72dbe4f722b124f5b697e258ccb11c3c8c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 28 May 2013 21:10:14 +0200 Subject: Add more tests for rcube_utils::explode_quoted_string() --- tests/Framework/Utils.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/Framework/Utils.php b/tests/Framework/Utils.php index 65efeecff..c62e688eb 100644 --- a/tests/Framework/Utils.php +++ b/tests/Framework/Utils.php @@ -194,6 +194,23 @@ class Framework_Utils extends PHPUnit_Framework_TestCase $this->assertEquals("/* evil! */", $mod, "Don't allow encoding quirks (2)"); } + /** + * Check rcube_utils::explode_quoted_string() + */ + function test_explode_quoted_string() + { + $data = array( + '"a,b"' => array('"a,b"'), + '"a,b","c,d"' => array('"a,b"','"c,d"'), + '"a,\\"b",d' => array('"a,\\"b"', 'd'), + ); + + foreach ($data as $text => $res) { + $result = rcube_utils::explode_quoted_string(',', $text); + $this->assertSame($res, $result); + } + } + /** * Check rcube_utils::explode_quoted_string() compat. with explode() */ -- cgit v1.2.3