Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added prop patch handle multiple remaining test #1

Open
wants to merge 1 commit into
base: tmp1
Choose a base branch
from
Open
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
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