[Pkg-owncloud-commits] [php-sabre-vobject] 250/341: TEL is of type TEXT by default, URI in vCard4.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit b1d95ea1d1c4e98eb82efe4db49e8d53371fab2c
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Thu Jan 29 11:09:45 2015 +0100

    TEL is of type TEXT by default, URI in vCard4.
---
 tests/VObject/JCardTest.php       |  2 +-
 tests/VObject/Parser/JsonTest.php |  2 +-
 tests/VObject/Parser/XmlTest.php  | 61 +++++++++++++++++++++++++++++++++++++--
 3 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/tests/VObject/JCardTest.php b/tests/VObject/JCardTest.php
index b5d93ec..0a2e977 100644
--- a/tests/VObject/JCardTest.php
+++ b/tests/VObject/JCardTest.php
@@ -92,7 +92,7 @@ class JCardTest extends \PHPUnit_Framework_TestCase {
                     (object)array(
                         "group" => "item1",
                     ),
-                    "uri",
+                    "text",
                     "+1 555 123456",
                 ),
                 array(
diff --git a/tests/VObject/Parser/JsonTest.php b/tests/VObject/Parser/JsonTest.php
index 94ef21b..a4d27b3 100644
--- a/tests/VObject/Parser/JsonTest.php
+++ b/tests/VObject/Parser/JsonTest.php
@@ -59,7 +59,7 @@ class JsonTest extends \PHPUnit_Framework_TestCase {
                     (object)array(
                         "group" => "item1",
                     ),
-                    "uri",
+                    "text",
                     "+1 555 123456",
                 ),
                 array(
diff --git a/tests/VObject/Parser/XmlTest.php b/tests/VObject/Parser/XmlTest.php
index d0bfe8f..555a436 100644
--- a/tests/VObject/Parser/XmlTest.php
+++ b/tests/VObject/Parser/XmlTest.php
@@ -1192,7 +1192,7 @@ XML
      */
     function testRFC6351Section5() {
 
-        $this->assertXMLReflexivelyEqualsToMimeDir(
+        $this->assertXMLEqualsToMimeDir(
 <<<XML
 <?xml version="1.0" encoding="UTF-8"?>
 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
@@ -1216,6 +1216,30 @@ XML
             'END:VCARD' . CRLF
         );
 
+        $this->assertXMLReflexivelyEqualsToMimeDir(
+<<<XML
+<?xml version="1.0" encoding="UTF-8"?>
+<vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
+ <vcard>
+  <tel>
+   <parameters>
+    <type>
+     <text>voice</text>
+     <text>video</text>
+    </type>
+   </parameters>
+   <text>tel:+1-555-555-555</text>
+  </tel>
+ </vcard>
+</vcards>
+XML
+,
+            'BEGIN:VCARD' . CRLF .
+            'VERSION:4.0' . CRLF .
+            'TEL;TYPE="voice,video":tel:+1-555-555-555' . CRLF .
+            'END:VCARD' . CRLF
+        );
+
     }
 
     /**
@@ -2059,7 +2083,17 @@ XML
      */
     function testRFC6350Section6_4_1() {
 
-        $this->assertXMLReflexivelyEqualsToMimeDir(
+        /**
+         * Quoting RFC:
+         * > Value type:  By default, it is a single free-form text value (for
+         * > backward compatibility with vCard 3), but it SHOULD be reset to a
+         * > URI value.  It is expected that the URI scheme will be "tel", as
+         * > specified in [RFC3966], but other schemes MAY be used.
+         *
+         * So first, we test xCard/URI to vCard/URI.
+         * Then, we test xCard/TEXT to vCard/TEXT to xCard/TEXT.
+         */
+        $this->assertXMLEqualsToMimeDir(
 <<<XML
 <?xml version="1.0" encoding="UTF-8"?>
 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
@@ -2082,6 +2116,29 @@ XML
             'END:VCARD' . CRLF
         );
 
+        $this->assertXMLReflexivelyEqualsToMimeDir(
+<<<XML
+<?xml version="1.0" encoding="UTF-8"?>
+<vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
+ <vcard>
+  <tel>
+   <parameters>
+    <type>
+     <text>home</text>
+    </type>
+   </parameters>
+   <text>tel:+33-01-23-45-67</text>
+  </tel>
+ </vcard>
+</vcards>
+XML
+,
+            'BEGIN:VCARD' . CRLF .
+            'VERSION:4.0' . CRLF .
+            'TEL;TYPE=home:tel:+33-01-23-45-67' . CRLF .
+            'END:VCARD' . CRLF
+        );
+
     }
 
     /**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list