kolabformat/php
Thomas Brüderli
bruederli at kolabsys.com
Thu Nov 8 14:29:40 CET 2012
kolabformat/php/test.php | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
New commits:
commit 3d7cd242f17548a2aea8b1ef3f2f23029cc9d052
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Thu Nov 8 14:24:00 2012 +0100
Added test case for distlist reading
diff --git a/kolabformat/php/test.php b/kolabformat/php/test.php
index 41a1dc6..49e8892 100644
--- a/kolabformat/php/test.php
+++ b/kolabformat/php/test.php
@@ -37,4 +37,44 @@ print "UID = " . $xo->getSerializedUID() . "\n\n";
print $xo->writeContact($c, kolabobject::KolabV3, "test.php");
print "UID = " . $xo->getSerializedUID() . "\n\n";
+
+$dlxml = <<<EOL
+<?xml version="1.0"?>
+<distribution-list version="1.0">
+ <uid>ebb1774429a2e03afafb31f233e23b42</uid>
+ <body></body>
+ <categories></categories>
+ <creation-date>2010-11-25T18:02:32Z</creation-date>
+ <last-modification-date>2011-07-23T09:06:38Z</last-modification-date>
+ <sensitivity>public</sensitivity>
+ <product-id>Horde::Kolab</product-id>
+ <display-name>Another lista</display-name>
+ <member>
+ <display-name>Another User</display-name>
+ <smtp-address>other at debian-vm.local</smtp-address>
+ <uid>a2cfdc52365ef429042413bf7717dc85</uid>
+ </member>
+ <member>
+ <display-name>Sample A. User Jr.</display-name>
+ <smtp-address>sample at debian-vm.local</smtp-address>
+ <uid>f538c7e9ad5a63e4452b7db3bc291231</uid>
+ </member>
+ <member>
+ <display-name>Sample A. User Jr.</display-name>
+ <smtp-address>alt at debian-vm.local</smtp-address>
+ <uid>f538c7e9ad5a63e4452b7db3bc291231</uid>
+ </member>
+</distribution-list>
+EOL;
+
+$xo = new XMLObject;
+$dl = new DistList($xo->readDistList($dlxml, kolabobject::KolabV2));
+
+echo $dl->uid() . "\n\n";
+$ml = $dl->members();
+for ($i=0; $i < $ml->size(); $i++) {
+ $m = $ml->get($i);
+ echo "Member [" . $m->type() . "]: " . $m->uid() . "; " . $m->email() . "\n";
+}
+
?>
More information about the commits
mailing list