Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/DAV/PropPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ public function handleRemaining(callable $callback)
foreach ($properties as $propertyName) {
// HTTP Accepted
$this->result[$propertyName] = 202;

$this->propertyUpdateCallbacks[] = [
$properties,
$callback,
];
}

$this->propertyUpdateCallbacks[] = [
$properties,
$callback,
];
}

/**
Expand Down
26 changes: 26 additions & 0 deletions tests/Sabre/DAV/PropPatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,32 @@ public function testHandleRemaining()
self::assertTrue($hasRan);
}

public function testHandleMultipleRemaining()
{
$cunCounter = 0;

$this->propPatch = new PropPatch([
'{DAV:}displayname' => 'foo',
'unittest' => 'bar',
]);

$this->propPatch->handleRemaining(function ($mutations) use (&$cunCounter) {
++$cunCounter;
self::assertCount(2, $mutations);

return true;
});

self::assertTrue($this->propPatch->commit());
$result = $this->propPatch->getResult();
self::assertEquals([
'{DAV:}displayname' => 200,
'unittest' => 200,
], $result);

self::assertSame(1, $cunCounter);
}

public function testHandleRemainingNothingToDo()
{
$hasRan = false;
Expand Down