aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
commit0b02a6d123b2014705998c94ddf3d460948d3eac (patch)
tree78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
downloadvolse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php30
1 files changed, 24 insertions, 6 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php b/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php
index ab7ac4e6a..3f96d3c5d 100644
--- a/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php
+++ b/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php
@@ -48,18 +48,36 @@ class Mock extends AbstractBackend {
}
- function updateAddressBook($addressBookId, array $mutations) {
+ /**
+ * Updates properties for an address book.
+ *
+ * The list of mutations is stored in a Sabre\DAV\PropPatch object.
+ * To do the actual updates, you must tell this object which properties
+ * you're going to process with the handle() method.
+ *
+ * Calling the handle method is like telling the PropPatch object "I
+ * promise I can handle updating this property".
+ *
+ * Read the PropPatch documenation for more info and examples.
+ *
+ * @param string $addressBookId
+ * @param \Sabre\DAV\PropPatch $propPatch
+ * @return void
+ */
+ public function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) {
foreach($this->addressBooks as &$book) {
if ($book['id'] !== $addressBookId)
continue;
- foreach($mutations as $key=>$value) {
- $book[$key] = $value;
- }
- return true;
+ $propPatch->handleRemaining(function($mutations) use (&$book) {
+ foreach($mutations as $key=>$value) {
+ $book[$key] = $value;
+ }
+ return true;
+ });
+
}
- return false;
}