summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-18 12:42:55 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-18 12:42:55 +0100
commit584e356920ced0e4cac68824062a7179926f3ad0 (patch)
tree30eecc61580a6bbdf2a7c52f1ee840ef93a00678 /tests
parentbe9aacaa5296dfca63fb3a01c2dc52538d1546aa (diff)
Fix so mobile phone has TYPE=CELL in exported vCard (#1488812)
Diffstat (limited to 'tests')
-rw-r--r--tests/Framework/VCard.php17
-rw-r--r--tests/src/johndoe.vcf1
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/Framework/VCard.php b/tests/Framework/VCard.php
index 56ca9d721..79d297664 100644
--- a/tests/Framework/VCard.php
+++ b/tests/Framework/VCard.php
@@ -33,6 +33,23 @@ class Framework_VCard extends PHPUnit_Framework_TestCase
$this->assertEquals("roundcube@gmail.com", $vcard->email[0], "Use PREF e-mail as primary");
}
+ /**
+ * Make sure MOBILE phone is returned as CELL (as specified in standard)
+ */
+ function test_parse_three()
+ {
+ $vcard = new rcube_vcard(file_get_contents($this->_srcpath('johndoe.vcf')), null);
+
+ $vcf = $vcard->export();
+ $this->assertRegExp('/TEL;CELL:\+987654321/', $vcf, "Return CELL instead of MOBILE (import)");
+
+ $vcard = new rcube_vcard();
+ $vcard->set('phone', '+987654321', 'MOBILE');
+
+ $vcf = $vcard->export();
+ $this->assertRegExp('/TEL;TYPE=CELL:\+987654321/', $vcf, "Return CELL instead of MOBILE (set)");
+ }
+
function test_import()
{
$input = file_get_contents($this->_srcpath('apple.vcf'));
diff --git a/tests/src/johndoe.vcf b/tests/src/johndoe.vcf
index 67b649df3..386afaf57 100644
--- a/tests/src/johndoe.vcf
+++ b/tests/src/johndoe.vcf
@@ -6,6 +6,7 @@ ORG:roundcube.net;
EMAIL;INTERNET;WORK:inbox@roundcube.net
EMAIL;INTERNET;HOME;TYPE=pref:roundcube@gmail.com
TEL;WORK:+123456789
+TEL;CELL:+987654321
ADR;WORK:;;The street;Hometown;;5555;Cayman Islands
NOTE:The notes...
END:VCARD