diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2013-01-18 21:26:18 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2013-01-18 21:26:18 +0100 |
commit | 6d41d8fd4bbd3f8854669fbf2fc5a4910803125a (patch) | |
tree | 4ed873eb2a6f975d2219d08e3aeeb65e75ccc925 /tests/Framework | |
parent | e24eba0fc5c45d0a42296ae5ddccc02556afda42 (diff) |
Fix format=flowed unfolding on quoted lines; added tests for rcube_mime::format_flowed() and rcube_mime::unfold_flowed()
Diffstat (limited to 'tests/Framework')
-rw-r--r-- | tests/Framework/Mime.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Framework/Mime.php b/tests/Framework/Mime.php index dcd55992a..1f9a8c58f 100644 --- a/tests/Framework/Mime.php +++ b/tests/Framework/Mime.php @@ -120,4 +120,26 @@ class Framework_Mime extends PHPUnit_Framework_TestCase $this->assertEquals($item['out'], $res, "Header decoding for: " . $idx); } } + + /** + * Test format=flowed unfolding + */ + function test_format_flowed() + { + $raw = file_get_contents(TESTS_DIR . 'src/format-flowed-unfolded.txt'); + $flowed = file_get_contents(TESTS_DIR . 'src/format-flowed.txt'); + + $this->assertEquals($flowed, rcube_mime::format_flowed($raw, 80), "Test correct folding and space-stuffing"); + } + + /** + * Test format=flowed unfolding + */ + function test_unfold_flowed() + { + $flowed = file_get_contents(TESTS_DIR . 'src/format-flowed.txt'); + $unfolded = file_get_contents(TESTS_DIR . 'src/format-flowed-unfolded.txt'); + + $this->assertEquals($unfolded, rcube_mime::unfold_flowed($flowed), "Test correct unfolding of quoted lines"); + } } |