summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-08 14:28:36 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-08 14:28:36 +0200
commita522971cf853b2f0ccd1b569491a06218ebbaee9 (patch)
treecf0e8c6bbe0978cf302b112080370b9a01cf5900 /tests
parentea6d6958e0a32c88bf8c00cbd118cfcd48fae096 (diff)
parentc4723999e21da0b266b0467de6e58cbd26c4b5bf (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Conflicts: program/js/list.js
Diffstat (limited to 'tests')
-rw-r--r--tests/Framework/Mime.php4
-rw-r--r--tests/Framework/VCard.php14
-rw-r--r--tests/src/Csv2vcard/tb_plain.csv2
-rw-r--r--tests/src/Csv2vcard/tb_plain.vcf2
-rw-r--r--tests/src/format-flowed-unfolded.txt2
-rw-r--r--tests/src/format-flowed.txt2
6 files changed, 22 insertions, 4 deletions
diff --git a/tests/Framework/Mime.php b/tests/Framework/Mime.php
index 61123dd85..3035ba062 100644
--- a/tests/Framework/Mime.php
+++ b/tests/Framework/Mime.php
@@ -185,6 +185,10 @@ class Framework_Mime extends PHPUnit_Framework_TestCase
array("----------------------------------------------------------------------------------------\nabc def123456789012345", 76),
"----------------------------------------------------------------------------------------\nabc def123456789012345",
),
+ array(
+ array("-------\nabc def", 5),
+ "-------\nabc\ndef",
+ ),
);
foreach ($samples as $sample) {
diff --git a/tests/Framework/VCard.php b/tests/Framework/VCard.php
index 15aa5d816..3353b5b13 100644
--- a/tests/Framework/VCard.php
+++ b/tests/Framework/VCard.php
@@ -65,6 +65,20 @@ class Framework_VCard extends PHPUnit_Framework_TestCase
$this->assertEquals("prefix", $vcard['prefix'], "Decode backslash character");
}
+ /**
+ * Backslash parsing test (#1489085)
+ */
+ function test_parse_five()
+ {
+ $vcard = "BEGIN:VCARD\nVERSION:3.0\nN:last\\\\\\a;fir\\nst\nURL:http\\://domain.tld\nEND:VCARD";
+ $vcard = new rcube_vcard($vcard, null);
+ $vcard = $vcard->get_assoc();
+
+ $this->assertEquals("last\\a", $vcard['surname'], "Decode dummy backslash character");
+ $this->assertEquals("fir\nst", $vcard['firstname'], "Decode backslash character");
+ $this->assertEquals("http://domain.tld", $vcard['website:other'][0], "Decode dummy backslash character");
+ }
+
function test_import()
{
$input = file_get_contents($this->_srcpath('apple.vcf'));
diff --git a/tests/src/Csv2vcard/tb_plain.csv b/tests/src/Csv2vcard/tb_plain.csv
index 94ea766c0..4c4af14ca 100644
--- a/tests/src/Csv2vcard/tb_plain.csv
+++ b/tests/src/Csv2vcard/tb_plain.csv
@@ -1,2 +1,2 @@
First Name,Last Name,Display Name,Nickname,Primary Email,Secondary Email,Screen Name,Work Phone,Home Phone,Fax Number,Pager Number,Mobile Number,Home Address,Home Address 2,Home City,Home State,Home ZipCode,Home Country,Work Address,Work Address 2,Work City,Work State,Work ZipCode,Work Country,Job Title,Department,Organization,Web Page 1,Web Page 2,Birth Year,Birth Month,Birth Day,Custom 1,Custom 2,Custom 3,Custom 4,Notes,
-Firstname,Lastname,Displayname,Nick,test@domain.tld,next@domain.tld,,phone work,phone home,fax,pager,mobile,Priv address,,City,region,xx-xxx,USA,Addr work,,city,region,33-333,Poland,title,department,Organization,http://page.com,http://webpage.tld,1970,11,15,,,,,,
+Firstname,Lastname,Displayname,Nick,test@domain.tld,next@domain.tld,,phone work,phone home,fax,pager,mobile,Priv address,,City,region,xx-xxx,USA,Addr work,,Wcity,Wstate,33-333,Poland,title,department,Organization,http://page.com,http://webpage.tld,1970,11,15,,,,,,
diff --git a/tests/src/Csv2vcard/tb_plain.vcf b/tests/src/Csv2vcard/tb_plain.vcf
index b001c3924..2aa91adf8 100644
--- a/tests/src/Csv2vcard/tb_plain.vcf
+++ b/tests/src/Csv2vcard/tb_plain.vcf
@@ -16,5 +16,5 @@ URL;TYPE=homepage:http://page.com
URL;TYPE=other:http://webpage.tld
BDAY;VALUE=date:1970-11-15
ADR;TYPE=home:;;Priv address;City;region;xx-xxx;USA
-ADR;TYPE=work:;;Addr work;;;33-333;Poland
+ADR;TYPE=work:;;Addr work;Wcity;Wstate;33-333;Poland
END:VCARD
diff --git a/tests/src/format-flowed-unfolded.txt b/tests/src/format-flowed-unfolded.txt
index 14e526be4..0af9b7130 100644
--- a/tests/src/format-flowed-unfolded.txt
+++ b/tests/src/format-flowed-unfolded.txt
@@ -5,7 +5,7 @@ X
On XX.YY.YYYY Y:YY, Somebody wrote:
> This part is a reply wihtout any flowing lines. rcube_mime::unfold_flowed()
-> has to be careful with empty quoted lines because they might end with a
+>> has to be careful with empty quoted lines because they might end with a
> space but still shouldn't be considered as flowed!
>
> The above empty line should persist after unfolding.
diff --git a/tests/src/format-flowed.txt b/tests/src/format-flowed.txt
index 359a41aec..da36064e0 100644
--- a/tests/src/format-flowed.txt
+++ b/tests/src/format-flowed.txt
@@ -7,7 +7,7 @@ X
On XX.YY.YYYY Y:YY, Somebody wrote:
> This part is a reply wihtout any flowing lines. rcube_mime::unfold_flowed()
-> has to be careful with empty quoted lines because they might end with a
+>> has to be careful with empty quoted lines because they might end with a
> space but still shouldn't be considered as flowed!
>
> The above empty line should persist after unfolding.