diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-09-09 16:50:14 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-09-09 16:50:14 +0200 |
commit | 8f66aa06f58ba2c9f99541a191ee4bcaa98500b3 (patch) | |
tree | a9e6e8b107042421756255341971e1b88964e176 /tests/Framework | |
parent | 00f34700632f7ff78df0c532d2605397820d0c79 (diff) |
Fix encoding vCard file when contains PHOTO;ENCODING=b (#1488683)
Diffstat (limited to 'tests/Framework')
-rw-r--r-- | tests/Framework/VCard.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Framework/VCard.php b/tests/Framework/VCard.php index a830c2cbc..56ca9d721 100644 --- a/tests/Framework/VCard.php +++ b/tests/Framework/VCard.php @@ -49,6 +49,20 @@ class Framework_VCard extends PHPUnit_Framework_TestCase $this->assertEquals("Iksiñski", $vcards2[0]->surname, "Detect charset in encoded values"); } + function test_import_photo_encoding() + { + $input = file_get_contents($this->_srcpath('photo.vcf')); + + $vcards = rcube_vcard::import($input); + $vcard = $vcards[0]->get_assoc(); + + $this->assertCount(1, $vcards, "Detected 1 vcard"); + + // ENCODING=b case (#1488683) + $this->assertEquals("/9j/4AAQSkZJRgABAQA", substr(base64_encode($vcard['photo']), 0, 19), "Photo decoding"); + $this->assertEquals("Müller", $vcard['surname'], "Unicode characters"); + } + function test_encodings() { $input = file_get_contents($this->_srcpath('utf-16_sample.vcf')); |