MFB: Add same test as on CVS though for the git version there is no code fix necessar...
authorGunnar Wrobel <p@rdus.de>
Tue, 11 Jan 2011 20:28:21 +0000 (21:28 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 11 Jan 2011 20:28:21 +0000 (21:28 +0100)
framework/Kolab_Format/package.xml
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/ContactTest.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact-kyr.xml [new file with mode: 0644]

index 9e6952d..b5df980 100644 (file)
@@ -29,8 +29,8 @@
   <email>jan@horde.org</email>
   <active>yes</active>
  </lead>
- <date>2010-12-10</date>
- <time>12:02:39</time>
+ <date>2011-01-11</date>
+ <time>21:25:25</time>
  <version>
   <release>1.1.0</release>
   <api>1.1.0</api>
        </dir> <!-- /test/Horde/Kolab/Format/fixtures -->
        <dir name="Integration">
         <dir name="fixtures">
+         <file name="contact-kyr.xml" role="test" />
          <file name="contact_category.xml" role="test" />
          <file name="contact_mail.xml" role="test" />
          <file name="contact_pgp.xml" role="test" />
    <install as="Horde/Kolab/Format/Integration/RecurrenceTest.php" name="test/Horde/Kolab/Format/Integration/RecurrenceTest.php" />
    <install as="Horde/Kolab/Format/Integration/TaskTest.php" name="test/Horde/Kolab/Format/Integration/TaskTest.php" />
    <install as="Horde/Kolab/Format/Integration/XmlTest.php" name="test/Horde/Kolab/Format/Integration/XmlTest.php" />
+   <install as="Horde/Kolab/Format/Integration/fixtures/contact-kyr.xml" name="test/Horde/Kolab/Format/Integration/fixtures/contact-kyr.xml" />
    <install as="Horde/Kolab/Format/Integration/fixtures/contact_category.xml" name="test/Horde/Kolab/Format/Integration/fixtures/contact_category.xml" />
    <install as="Horde/Kolab/Format/Integration/fixtures/contact_mail.xml" name="test/Horde/Kolab/Format/Integration/fixtures/contact_mail.xml" />
    <install as="Horde/Kolab/Format/Integration/fixtures/contact_pgp.xml" name="test/Horde/Kolab/Format/Integration/fixtures/contact_pgp.xml" />
     <release>stable</release>
     <api>stable</api>
    </stability>
-   <date>2010-12-10</date>
+   <date>2011-01-11</date>
    <license uri="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</license>
    <notes>
 * Removed dependency on the Kolab package within the task handler.
index 33eb0ee..d22e811 100644 (file)
@@ -99,6 +99,19 @@ extends PHPUnit_Framework_TestCase
         $this->assertContains('Test', $object['categories']);
     }
 
+    public function testUtf8()
+    {
+        $contact = new Horde_Kolab_Format_Xml_Contact(
+            new Horde_Kolab_Format_Xml_Parser(
+                new DOMDocument('1.0', 'UTF-8')
+            )
+        );
+        $xml = file_get_contents(dirname(__FILE__) . '/fixtures/contact-kyr.xml');
+
+        $object = $contact->load($xml);
+        $this->assertEquals('леле  Какакака', $object['full-name']);
+    }
+
     /* /\** */
     /*  * Test loading a contact with a category with preferences. */
     /*  * */
diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact-kyr.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact-kyr.xml
new file mode 100644 (file)
index 0000000..a46b7c3
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<contact version="1.0">
+  <uid>20110111175940.2085781xeofrt3ks@legolas.home.edu</uid>
+  <body></body>
+  <categories></categories>
+  <creation-date>2011-01-11T15:59:41Z</creation-date>
+  <last-modification-date>2011-01-11T16:05:27Z</last-modification-date>
+  <sensitivity>public</sensitivity>
+  <product-id>Horde::Kolab</product-id>
+  <name>
+    <given-name>&#x43B;&#x435;&#x43B;&#x435;</given-name>
+    <middle-names></middle-names>
+    <last-name>&#x41A;&#x430;&#x43A;&#x430;&#x43A;&#x430;&#x43A;&#x430; &#x43B;&#x435; &#x433;</last-name>
+    <full-name>&#x43B;&#x435;&#x43B;&#x435;  &#x41A;&#x430;&#x43A;&#x430;&#x43A;&#x430;&#x43A;&#x430;</full-name>
+    <initials></initials>
+    <prefix></prefix>
+    <suffix></suffix>
+  </name>
+  <free-busy-url></free-busy-url>
+  <organization></organization>
+  <web-page></web-page>
+  <im-address></im-address>
+  <department></department>
+  <office-location></office-location>
+  <profession></profession>
+  <job-title></job-title>
+  <manager-name></manager-name>
+  <assistant></assistant>
+  <nick-name></nick-name>
+  <spouse-name></spouse-name>
+  <children></children>
+  <language></language>
+  <latitude></latitude>
+  <longitude></longitude>
+</contact>