Skip to content

Commit

Permalink
added prop patch handle multiple remaining test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmhh committed Sep 6, 2024
1 parent a71ccda commit 0ddc3e6
Showing 1 changed file with 26 additions and 0 deletions.
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 += 1;
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

0 comments on commit 0ddc3e6

Please sign in to comment.