Skip to content

Commit 22add11

Browse files
committed
added prop patch handle multiple remaining test
1 parent a71ccda commit 22add11

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/Sabre/DAV/PropPatchTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,32 @@ public function testHandleRemaining()
121121
self::assertTrue($hasRan);
122122
}
123123

124+
public function testHandleMultipleRemaining()
125+
{
126+
$cunCounter = 0;
127+
128+
$this->propPatch = new PropPatch([
129+
'{DAV:}displayname' => 'foo',
130+
'unittest' => 'bar',
131+
]);
132+
133+
$this->propPatch->handleRemaining(function ($mutations) use (&$cunCounter) {
134+
++$cunCounter;
135+
self::assertCount(2, $mutations);
136+
137+
return true;
138+
});
139+
140+
self::assertTrue($this->propPatch->commit());
141+
$result = $this->propPatch->getResult();
142+
self::assertEquals([
143+
'{DAV:}displayname' => 200,
144+
'unittest' => 200,
145+
], $result);
146+
147+
self::assertSame(1, $cunCounter);
148+
}
149+
124150
public function testHandleRemainingNothingToDo()
125151
{
126152
$hasRan = false;

0 commit comments

Comments
 (0)