[Pkg-owncloud-commits] [php-sabredav] 28/42: Test for EmailAddressSet
David Prévot
taffit at moszumanska.debian.org
Fri Nov 28 22:47:50 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabredav.
commit e09e276a08314aa518a247d2b4655d286de6980d
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Wed Nov 19 23:41:07 2014 -0500
Test for EmailAddressSet
---
.../Sabre/CalDAV/Property/EmailAddressSetTest.php | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/tests/Sabre/CalDAV/Property/EmailAddressSetTest.php b/tests/Sabre/CalDAV/Property/EmailAddressSetTest.php
new file mode 100644
index 0000000..6af1c7e
--- /dev/null
+++ b/tests/Sabre/CalDAV/Property/EmailAddressSetTest.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace Sabre\CalDAV\Property;
+
+class EmailAddressSetTest extends \PHPUnit_Framework_TestCase {
+
+ function testSimple() {
+
+ $eas = new EmailAddressSet(['foo at example.org']);
+ $this->assertEquals(['foo at example.org'], $eas->getValue());
+
+ }
+
+ /**
+ * @depends testSimple
+ */
+ function testSerialize() {
+
+ $property = new EmailAddressSet(['foo at example.org']);
+
+ $doc = new \DOMDocument();
+ $root = $doc->createElement('d:root');
+ $root->setAttribute('xmlns:d','DAV:');
+ $root->setAttribute('xmlns:cs',\Sabre\CalDAV\Plugin::NS_CALENDARSERVER);
+
+ $doc->appendChild($root);
+ $server = new \Sabre\DAV\Server();
+ $server->addPlugin(new \Sabre\CalDAV\Plugin());
+
+ $property->serialize($server, $root);
+
+ $xml = $doc->saveXML();
+
+ $this->assertEquals(
+'<?xml version="1.0"?>
+<d:root xmlns:d="DAV:" xmlns:cs="' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '">' .
+'<cs:email-address>foo at example.org</cs:email-address>' .
+'</d:root>
+', $xml);
+
+ }
+
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list