12 '{DAV:}displayname' =>
'foo',
14 $this->assertEquals([
'{DAV:}displayname' =>
'foo'], $this->propPatch->getMutations());
22 $this->propPatch->handle(
'{DAV:}displayname',
function($value) use (&$hasRan) {
24 $this->assertEquals(
'foo', $value);
28 $this->assertTrue($this->propPatch->commit());
29 $result = $this->propPatch->getResult();
30 $this->assertEquals([
'{DAV:}displayname' => 200], $result);
32 $this->assertTrue($hasRan);
40 $this->propPatch->handle(
'{DAV:}displayname',
function($value) use (&$hasRan) {
42 $this->assertEquals(
'foo', $value);
46 $this->assertFalse($this->propPatch->commit());
47 $result = $this->propPatch->getResult();
48 $this->assertEquals([
'{DAV:}displayname' => 403], $result);
50 $this->assertTrue($hasRan);
58 $this->propPatch->handle(
'{DAV:}displayname',
function($value) use (&$hasRan) {
60 $this->assertEquals(
'foo', $value);
64 $this->assertTrue($this->propPatch->commit());
65 $result = $this->propPatch->getResult();
66 $this->assertEquals([
'{DAV:}displayname' => 201], $result);
68 $this->assertTrue($hasRan);
76 $this->propPatch =
new PropPatch([
'{DAV:}displayname' => null]);
77 $this->propPatch->handle(
'{DAV:}displayname',
function($value) use (&$hasRan) {
79 $this->assertNull($value);
83 $this->assertTrue($this->propPatch->commit());
84 $result = $this->propPatch->getResult();
85 $this->assertEquals([
'{DAV:}displayname' => 204], $result);
87 $this->assertTrue($hasRan);
96 $this->propPatch->handle(
'{DAV:}foobar',
function($value) use (&$hasRan) {
100 $this->assertFalse($hasRan);
111 $this->propPatch->handleRemaining(
function($mutations) use (&$hasRan) {
113 $this->assertEquals([
'{DAV:}displayname' =>
'foo'], $mutations);
117 $this->assertTrue($this->propPatch->commit());
118 $result = $this->propPatch->getResult();
119 $this->assertEquals([
'{DAV:}displayname' => 200], $result);
121 $this->assertTrue($hasRan);
128 $this->propPatch->handle(
'{DAV:}displayname',
function() {});
129 $this->propPatch->handleRemaining(
function($mutations) use (&$hasRan) {
133 $this->assertFalse($hasRan);
139 $this->propPatch->setResultCode(
'{DAV:}displayname', 201);
140 $this->assertTrue($this->propPatch->commit());
141 $result = $this->propPatch->getResult();
142 $this->assertEquals([
'{DAV:}displayname' => 201], $result);
148 $this->propPatch->setResultCode(
'{DAV:}displayname', 402);
149 $this->assertFalse($this->propPatch->commit());
150 $result = $this->propPatch->getResult();
151 $this->assertEquals([
'{DAV:}displayname' => 402], $result);
157 $this->propPatch->setRemainingResultCode(204);
158 $this->assertTrue($this->propPatch->commit());
159 $result = $this->propPatch->getResult();
160 $this->assertEquals([
'{DAV:}displayname' => 204], $result);
166 $this->assertFalse($this->propPatch->commit());
167 $result = $this->propPatch->getResult();
168 $this->assertEquals([
'{DAV:}displayname' => 403], $result);
176 $this->propPatch->setResultCode(
'{DAV:}displayname', 402);
177 $this->propPatch->handle(
'{DAV:}displayname',
function($value) use (&$hasRan) {
181 $this->propPatch->commit();
184 $this->assertFalse($hasRan);
198 $propPatch->handle(
'{DAV:}a',
function() use (&$calledA) {
202 $propPatch->handle(
'{DAV:}b',
function() use (&$calledB) {
208 $this->assertTrue($calledA);
209 $this->assertFalse($calledB);
213 $this->assertEquals([
246 $propPatch->handle([
'{DAV:}a',
'{DAV:}b',
'{DAV:}c'],
function($properties) use (&$calledA) {
248 $this->assertEquals([
256 $this->assertTrue($calledA);
259 $this->assertEquals([
278 $propPatch->handle([
'{DAV:}a',
'{DAV:}b',
'{DAV:}c'],
function($properties) use (&$calledA) {
280 $this->assertEquals([
288 $this->assertTrue($calledA);
291 $this->assertEquals([
309 $propPatch->handle([
'{DAV:}a',
'{DAV:}b',
'{DAV:}c'],
function($properties) use (&$calledA) {
311 $this->assertEquals([
323 $this->assertTrue($calledA);
326 $this->assertEquals([
345 $propPatch->handle([
'{DAV:}a',
'{DAV:}b',
'{DAV:}c'],
function($properties) {
testHandleRemaining()
testHandleSingleSuccess
This class represents a set of properties that are going to be updated.
testHandleSingleSuccess()
testHandleMultiValueFail()
testHandleSingleBrokenResult()
testSetRemainingResultCode()
testHandleMultiValueBroken()
testHandleMultiValueSuccess()
testHandleRemainingNothingToDo()
testHandleMultiValueCustomResult()
testHandleSingleCustomResult()
testHandleSingleDeleteSuccess()