[Pkg-owncloud-commits] [php-sabredav] 173/275: Test for supported-collation-set.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:56:05 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 62c9b9a86c3a35f0d22b0d27d458eb921c4080d9
Author: Evert Pot <me at evertpot.com>
Date:   Thu Aug 21 18:15:51 2014 -0400

    Test for supported-collation-set.
---
 lib/CardDAV/Property/SupportedCollationSet.php     |  2 +-
 .../CardDAV/Property/SupportedCollationSetTest.php | 46 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/lib/CardDAV/Property/SupportedCollationSet.php b/lib/CardDAV/Property/SupportedCollationSet.php
index ea64227..23bcfc4 100644
--- a/lib/CardDAV/Property/SupportedCollationSet.php
+++ b/lib/CardDAV/Property/SupportedCollationSet.php
@@ -22,7 +22,7 @@ class SupportedCollationSet extends DAV\Property {
      * @param \DOMElement $node
      * @return void
      */
-    public function serialize(DAV\Server $server,\DOMElement $node) {
+    function serialize(DAV\Server $server,\DOMElement $node) {
 
         $doc = $node->ownerDocument;
 
diff --git a/tests/Sabre/CardDAV/Property/SupportedCollationSetTest.php b/tests/Sabre/CardDAV/Property/SupportedCollationSetTest.php
new file mode 100644
index 0000000..7cc92ce
--- /dev/null
+++ b/tests/Sabre/CardDAV/Property/SupportedCollationSetTest.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Sabre\CardDAV\Property;
+
+use Sabre\CardDAV;
+use Sabre\DAV;
+
+class SupportedCollationSetTest extends \PHPUnit_Framework_TestCase {
+
+    function testSimple() {
+
+        $property = new SupportedCollationSet();
+        $this->assertInstanceOf('Sabre\CardDAV\Property\SupportedCollationSet', $property);
+
+    }
+
+    /**
+     * @depends testSimple
+     */
+    function testSerialize() {
+
+        $property = new SupportedCollationSet();
+
+        $doc = new \DOMDocument();
+        $root = $doc->createElementNS(CardDAV\Plugin::NS_CARDDAV, 'card:root');
+        $root->setAttribute('xmlns:d','DAV:');
+
+        $doc->appendChild($root);
+        $server = new DAV\Server();
+
+        $property->serialize($server, $root);
+
+        $xml = $doc->saveXML();
+
+        $this->assertEquals(
+'<?xml version="1.0"?>
+<card:root xmlns:card="' . CardDAV\Plugin::NS_CARDDAV . '" xmlns:d="DAV:">' .
+'<card:supported-collation>i;ascii-casemap</card:supported-collation>' .
+'<card:supported-collation>i;octet</card:supported-collation>' .
+'<card:supported-collation>i;unicode-casemap</card:supported-collation>' .
+'</card: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