diff vendor/sabre/vobject/tests/VObject/Issue40Test.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/sabre/vobject/tests/VObject/Issue40Test.php	Sat Jan 13 09:06:10 2018 -0500
@@ -0,0 +1,30 @@
+<?php
+
+namespace Sabre\VObject;
+
+/**
+ * This test is created to handle the issues brought forward by issue 40.
+ *
+ * https://github.com/fruux/sabre-vobject/issues/40
+ */
+class Issue40Test extends \PHPUnit_Framework_TestCase {
+
+    function testEncode() {
+
+        $card = new Component\VCard();
+        $card->add('N', array('van der Harten', array('Rene','J.'), "", 'Sir','R.D.O.N.'), array('SORT-AS' => array('Harten','Rene')));
+
+        $expected = implode("\r\n", array(
+            "BEGIN:VCARD",
+            "VERSION:3.0",
+            "PRODID:-//Sabre//Sabre VObject " . Version::VERSION . '//EN',
+            "N;SORT-AS=Harten,Rene:van der Harten;Rene,J.;;Sir;R.D.O.N.",
+            "END:VCARD",
+            ""
+        ));
+
+        $this->assertEquals($expected, $card->serialize());
+
+    }
+
+}