3 class Sabre_DAV_ServerUpdatePropertiesTest extends PHPUnit_Framework_TestCase {
5 function testUpdatePropertiesFail() {
8 new Sabre_DAV_SimpleCollection('foo'),
10 $server = new Sabre_DAV_Server($tree);
12 $result = $server->updateProperties('foo', array(
22 $this->assertEquals($expected, $result);
26 function testUpdatePropertiesProtected() {
29 new Sabre_DAV_SimpleCollection('foo'),
31 $server = new Sabre_DAV_Server($tree);
33 $result = $server->updateProperties('foo', array(
34 '{DAV:}getetag' => 'bla',
41 '{DAV:}getetag' => null,
47 $this->assertEquals($expected, $result);
51 function testUpdatePropertiesEventFail() {
54 new Sabre_DAV_SimpleCollection('foo'),
56 $server = new Sabre_DAV_Server($tree);
57 $server->subscribeEvent('updateProperties', array($this,'updatepropfail'));
59 $result = $server->updateProperties('foo', array(
61 '{DAV:}foo2' => 'bla',
73 $this->assertEquals($expected, $result);
77 function updatePropFail(&$propertyDelta, &$result, $node) {
82 unset($propertyDelta['{DAV:}foo']);
88 function testUpdatePropertiesEventSuccess() {
91 new Sabre_DAV_SimpleCollection('foo'),
93 $server = new Sabre_DAV_Server($tree);
94 $server->subscribeEvent('updateProperties', array($this,'updatepropsuccess'));
96 $result = $server->updateProperties('foo', array(
98 '{DAV:}foo2' => 'bla',
107 '{DAV:}foo2' => null,
110 $this->assertEquals($expected, $result);
114 function updatePropSuccess(&$propertyDelta, &$result, $node) {
116 $result[200] = array(
119 $result[201] = array(
120 '{DAV:}foo2' => null,
122 unset($propertyDelta['{DAV:}foo']);
123 unset($propertyDelta['{DAV:}foo2']);