summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2012-06-06 08:07:47 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2012-06-06 08:07:47 (GMT)
commitf530d6dd9bb6058e0f443de8db2e8d8e5cd020f7 (patch)
tree39197ef8fa24777e996d474212abc7f0702f15b1
parent6ff67e345780ba9dd7a92047a1f11ef114fe2cc6 (diff)
downloadlibkolabxml-f530d6dd9bb6058e0f443de8db2e8d8e5cd020f7.tar.gz
Add tests for configuration objects
-rwxr-xr-xsrc/php/test.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/php/test.php b/src/php/test.php
index 8ecc8c3..1da42f2 100755
--- a/src/php/test.php
+++ b/src/php/test.php
@@ -189,6 +189,32 @@ assertcontains($xml, '<fn><text>DalistÄÖŸ</text></fn>', "kolabformat::writeDi
assertcontains($xml, '<uri>mailto:Member%2DA%3Ca%40localhost%3E</uri>', "kolabformat::writeDistlist(): mailto uri");
assertcontains($xml, '<member><uri>urn:uuid:x-member-b-fff</uri>', "kolabformat::writeDistlist(): member urn::uuid");
+
+
+/////// Test Configuration.Dictionary
+
+$d = new Dictionary('de');
+$d->setEntries(array2vector(array('Kolab','Roundcube','libkolabxml')));
+$c = new Configuration($d);
+
+$xml = kolabformat::writeConfiguration($c);
+#print $xml;
+$c2 = kolabformat::readConfiguration($xml, false);
+$d2 = $c2->dictionary();
+
+assertequal($d2->language(), 'de', "Configuration.Dictionary::language");
+assertequal($d2->entries()->size(), 3, "Dictionary::entries()");
+
+$d = new Dictionary('en');
+$d->setEntries(array2vector(array('Kolab','Roundcube','libkolabxml')));
+$c = new Configuration($d);
+
+$xml = kolabformat::writeConfiguration($c);
+#print $xml;
+$c3 = kolabformat::readConfiguration($xml, false);
+
+asserttrue($c2->uid() != $c3->uid(), "Generate different UIDs for configuration objects");
+
?>