From 0ddc3e6d071d0677d8b7976fa3c57356146de640 Mon Sep 17 00:00:00 2001 From: Paul Mehrer Date: Fri, 6 Sep 2024 15:02:07 +0200 Subject: [PATCH] added prop patch handle multiple remaining test --- tests/Sabre/DAV/PropPatchTest.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/Sabre/DAV/PropPatchTest.php b/tests/Sabre/DAV/PropPatchTest.php index 2f71dc357e..acda381bd8 100644 --- a/tests/Sabre/DAV/PropPatchTest.php +++ b/tests/Sabre/DAV/PropPatchTest.php @@ -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;