From e68fa71b0eb66a12adcdf35c411c6f83970749ec Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 5 Nov 2012 19:22:09 +0100 Subject: Fixed rcube_imap_generic::uncompressMessageSet() result when argument is empty. Added tests. --- tests/Framework/ImapGeneric.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/Framework/ImapGeneric.php') diff --git a/tests/Framework/ImapGeneric.php b/tests/Framework/ImapGeneric.php index 0b2cc3d53..2f9b6d10f 100644 --- a/tests/Framework/ImapGeneric.php +++ b/tests/Framework/ImapGeneric.php @@ -17,4 +17,22 @@ class Framework_ImapGeneric extends PHPUnit_Framework_TestCase $this->assertInstanceOf('rcube_imap_generic', $object, "Class constructor"); } + + /** + * Test for uncompressMessageSet + */ + function test_uncompressMessageSet() + { + $result = rcube_imap_generic::uncompressMessageSet(null); + $this->assertSame(array(), $result); + $this->assertCount(0, $result); + + $result = rcube_imap_generic::uncompressMessageSet('1'); + $this->assertSame(array(1), $result); + $this->assertCount(1, $result); + + $result = rcube_imap_generic::uncompressMessageSet('1:3'); + $this->assertSame(array(1, 2, 3), $result); + $this->assertCount(3, $result); + } } -- cgit v1.2.3