[Pkg-owncloud-commits] [php-sabre-vobject] 11/43: test for vcard converter issue

David Prévot taffit at moszumanska.debian.org
Sat Jan 10 14:20:13 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 969afea733012415c1662d90e735227e3b30e746
Author: Dominik Tobschall <dominik at fruux.com>
Date:   Mon Dec 22 14:28:17 2014 +0100

    test for vcard converter issue
---
 tests/VObject/IssueXXTest.php | 47 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/tests/VObject/IssueXXTest.php b/tests/VObject/IssueXXTest.php
new file mode 100644
index 0000000..2e76086
--- /dev/null
+++ b/tests/VObject/IssueXXTest.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace Sabre\VObject;
+
+class IssueXXTest extends \PHPUnit_Framework_TestCase {
+
+  function testConvert() {
+
+    $input = <<<VCF
+BEGIN:VCARD
+VERSION:3.0
+UID:foo
+N:Doe;John;;;
+FN:John Doe
+item1.X-ABDATE;type=pref:2008-12-11
+END:VCARD
+
+VCF;
+
+    $vcard = Reader::read($input);
+
+    $this->assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard);
+    $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD40);
+    $vcard = $vcard->serialize();
+
+    $converted = Reader::read($vcard);
+    $converted->validate();
+
+    $version = Version::VERSION;
+
+    $expected = <<<VCF
+BEGIN:VCARD
+VERSION:4.0
+PRODID:-//Sabre//Sabre VObject $version//EN
+UID:foo
+N:Doe;John;;;
+FN:John Doe
+ITEM1.X-ABDATE;PREF=1:2008-12-11
+END:VCARD
+
+VCF;
+
+    $this->assertEquals($expected, str_replace("\r","", $vcard));
+
+  }
+
+}

-- 
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