aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/ServerUpdatePropertiesTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/ServerUpdatePropertiesTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ServerUpdatePropertiesTest.php63
1 files changed, 31 insertions, 32 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerUpdatePropertiesTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerUpdatePropertiesTest.php
index 7fde11b22..383f8e657 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ServerUpdatePropertiesTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerUpdatePropertiesTest.php
@@ -1,101 +1,100 @@
<?php
namespace Sabre\DAV;
-use Sabre\HTTP;
class ServerUpdatePropertiesTest extends \PHPUnit_Framework_TestCase {
function testUpdatePropertiesFail() {
- $tree = array(
+ $tree = [
new SimpleCollection('foo'),
- );
+ ];
$server = new Server($tree);
- $result = $server->updateProperties('foo', array(
+ $result = $server->updateProperties('foo', [
'{DAV:}foo' => 'bar'
- ));
+ ]);
- $expected = array(
+ $expected = [
'{DAV:}foo' => 403,
- );
+ ];
$this->assertEquals($expected, $result);
}
function testUpdatePropertiesProtected() {
- $tree = array(
+ $tree = [
new SimpleCollection('foo'),
- );
+ ];
$server = new Server($tree);
$server->on('propPatch', function($path, PropPatch $propPatch) {
$propPatch->handleRemaining(function() { return true; });
});
- $result = $server->updateProperties('foo', array(
+ $result = $server->updateProperties('foo', [
'{DAV:}getetag' => 'bla',
- '{DAV:}foo' => 'bar'
- ));
+ '{DAV:}foo' => 'bar'
+ ]);
- $expected = array(
+ $expected = [
'{DAV:}getetag' => 403,
- '{DAV:}foo' => 424,
- );
+ '{DAV:}foo' => 424,
+ ];
$this->assertEquals($expected, $result);
}
function testUpdatePropertiesEventFail() {
- $tree = array(
+ $tree = [
new SimpleCollection('foo'),
- );
+ ];
$server = new Server($tree);
$server->on('propPatch', function($path, PropPatch $propPatch) {
$propPatch->setResultCode('{DAV:}foo', 404);
$propPatch->handleRemaining(function() { return true; });
});
- $result = $server->updateProperties('foo', array(
- '{DAV:}foo' => 'bar',
+ $result = $server->updateProperties('foo', [
+ '{DAV:}foo' => 'bar',
'{DAV:}foo2' => 'bla',
- ));
+ ]);
- $expected = array(
- '{DAV:}foo' => 404,
+ $expected = [
+ '{DAV:}foo' => 404,
'{DAV:}foo2' => 424,
- );
+ ];
$this->assertEquals($expected, $result);
}
function testUpdatePropertiesEventSuccess() {
- $tree = array(
+ $tree = [
new SimpleCollection('foo'),
- );
+ ];
$server = new Server($tree);
$server->on('propPatch', function($path, PropPatch $propPatch) {
$propPatch->handle(['{DAV:}foo', '{DAV:}foo2'], function() {
return [
- '{DAV:}foo' => 200,
+ '{DAV:}foo' => 200,
'{DAV:}foo2' => 201,
];
});
});
- $result = $server->updateProperties('foo', array(
- '{DAV:}foo' => 'bar',
+ $result = $server->updateProperties('foo', [
+ '{DAV:}foo' => 'bar',
'{DAV:}foo2' => 'bla',
- ));
+ ]);
- $expected = array(
- '{DAV:}foo' => 200,
+ $expected = [
+ '{DAV:}foo' => 200,
'{DAV:}foo2' => 201,
- );
+ ];
$this->assertEquals($expected, $result);
}