From e8e2e76ed987d911ec878345e88d3c611a4b7b32 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Mon, 17 Sep 2012 13:25:57 -0400
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail

---
 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 a830c2c..56ca9d7 100644
--- a/tests/Framework/VCard.php
+++ b/tests/Framework/VCard.php
@@ -49,6 +49,20 @@
         $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'));

--
Gitblit v1.9.1