[Pkg-owncloud-commits] [php-sabredav] 37/42: TooMuhchMatches was broken.

David Prévot taffit at moszumanska.debian.org
Wed Jul 23 16:41:27 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 176a045926308b80cd648c2af0e77ac12b6f67c0
Author: Evert Pot <me at evertpot.com>
Date:   Wed Jul 2 15:01:18 2014 -0400

    TooMuhchMatches was broken.
    
    Fixed this problem, and renamed to TooManyMatches.
    
    Fixes #478.
---
 ChangeLog.md                                       |  2 ++
 .../{TooMuchMatches.php => TooManyMatches.php}     |  4 +--
 tests/Sabre/DAV/Exception/TooManyMatchesTest.php   | 36 ++++++++++++++++++++++
 3 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 716ae50..f85cf14 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -8,6 +8,8 @@ ChangeLog
 * #476: CSP policy incorrect, causing stylesheets to not load in the browser
   plugin.
 * #475: Href properties in the browser plugin sometimes included a backslash.
+* #478: `TooMuchMatches` exception never worked. This was fixed, and we also
+  took this opportunity to rename it to `TooManyMatches`.
 
 2.0.2 (2014-06-12)
 ------------------
diff --git a/lib/DAV/Exception/TooMuchMatches.php b/lib/DAV/Exception/TooManyMatches.php
similarity index 94%
rename from lib/DAV/Exception/TooMuchMatches.php
rename to lib/DAV/Exception/TooManyMatches.php
index 49e74f9..19bfbb8 100644
--- a/lib/DAV/Exception/TooMuchMatches.php
+++ b/lib/DAV/Exception/TooManyMatches.php
@@ -5,7 +5,7 @@ namespace Sabre\DAV\Exception;
 use Sabre\DAV;
 
 /**
- * TooMuchMatches
+ * TooManyMatches
  *
  * This exception is emited for the {DAV:}number-of-matches-within-limits
  * post-condition, as defined in rfc6578, section 3.2.
@@ -19,7 +19,7 @@ use Sabre\DAV;
  * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/).
  * @license http://sabre.io/license/ Modified BSD License
  */
-class TooMuchMatches extends DAV\Forbidden {
+class TooManyMatches extends Forbidden {
 
     /**
      * This method allows the exception to include additional information into the WebDAV error response
diff --git a/tests/Sabre/DAV/Exception/TooManyMatchesTest.php b/tests/Sabre/DAV/Exception/TooManyMatchesTest.php
new file mode 100644
index 0000000..a8b28c6
--- /dev/null
+++ b/tests/Sabre/DAV/Exception/TooManyMatchesTest.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Sabre\DAV\Exception;
+
+use
+    Sabre\DAV,
+    DOMDocument;
+
+class TooManyMatchesTest extends \PHPUnit_Framework_TestCase {
+
+    function testSerialize() {
+
+        $dom = new DOMDocument('1.0');
+        $dom->formatOutput = true;
+        $root = $dom->createElement('d:root');
+
+        $dom->appendChild($root);
+        $root->setAttribute('xmlns:d','DAV:');
+
+        $locked = new TooManyMatches();
+
+        $locked->serialize(new DAV\Server(), $root);
+
+        $output = $dom->saveXML();
+
+        $expected = '<?xml version="1.0"?>
+<d:root xmlns:d="DAV:">
+  <d:number-of-matches-within-limits xmlns:d="DAV:"/>
+</d:root>
+';
+
+        $this->assertEquals($expected, $output);
+
+    }
+
+}

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