aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-05-28 17:46:24 +0200
committerMario Vavti <mario@mariovavti.com>2016-05-28 17:46:24 +0200
commit66effbfe0827fc61fff6d248797a894213ad20d6 (patch)
tree0fbb5ca644e1140e5b3b44b1adc874043790c388 /vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php
parentac4688eac087854bf8cb0c893d7a79052ad63a20 (diff)
downloadvolse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.tar.gz
volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.tar.bz2
volse-hubzilla-66effbfe0827fc61fff6d248797a894213ad20d6.zip
upgrade to sabre32
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php67
1 files changed, 36 insertions, 31 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php
index 64cedd142..0147e6a61 100644
--- a/vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php
@@ -3,28 +3,25 @@
namespace Sabre\DAVACL;
use Sabre\DAV;
-use Sabre\HTTP;
-
-
-require_once 'Sabre/DAVACL/MockPrincipal.php';
class PluginUpdatePropertiesTest extends \PHPUnit_Framework_TestCase {
function testUpdatePropertiesPassthrough() {
- $tree = array(
+ $tree = [
new DAV\SimpleCollection('foo'),
- );
+ ];
$server = new DAV\Server($tree);
+ $server->addPlugin(new DAV\Auth\Plugin());
$server->addPlugin(new Plugin());
- $result = $server->updateProperties('foo', array(
+ $result = $server->updateProperties('foo', [
'{DAV:}foo' => 'bar',
- ));
+ ]);
- $expected = array(
+ $expected = [
'{DAV:}foo' => 403,
- );
+ ];
$this->assertEquals($expected, $result);
@@ -32,35 +29,39 @@ class PluginUpdatePropertiesTest extends \PHPUnit_Framework_TestCase {
function testRemoveGroupMembers() {
- $tree = array(
- new MockPrincipal('foo','foo'),
- );
+ $tree = [
+ new MockPrincipal('foo', 'foo'),
+ ];
$server = new DAV\Server($tree);
- $server->addPlugin(new Plugin());
+ $plugin = new Plugin();
+ $plugin->allowUnauthenticatedAccess = false;
+ $server->addPlugin($plugin);
- $result = $server->updateProperties('foo', array(
+ $result = $server->updateProperties('foo', [
'{DAV:}group-member-set' => null,
- ));
+ ]);
- $expected = array(
+ $expected = [
'{DAV:}group-member-set' => 204
- );
+ ];
$this->assertEquals($expected, $result);
- $this->assertEquals(array(),$tree[0]->getGroupMemberSet());
+ $this->assertEquals([], $tree[0]->getGroupMemberSet());
}
function testSetGroupMembers() {
$tree = [
- new MockPrincipal('foo','foo'),
+ new MockPrincipal('foo', 'foo'),
];
$server = new DAV\Server($tree);
- $server->addPlugin(new Plugin());
+ $plugin = new Plugin();
+ $plugin->allowUnauthenticatedAccess = false;
+ $server->addPlugin($plugin);
$result = $server->updateProperties('foo', [
- '{DAV:}group-member-set' => new DAV\Xml\Property\Href(['/bar','/baz'], true),
+ '{DAV:}group-member-set' => new DAV\Xml\Property\Href(['/bar', '/baz'], true),
]);
$expected = [
@@ -68,7 +69,7 @@ class PluginUpdatePropertiesTest extends \PHPUnit_Framework_TestCase {
];
$this->assertEquals($expected, $result);
- $this->assertEquals(['bar', 'baz'],$tree[0]->getGroupMemberSet());
+ $this->assertEquals(['bar', 'baz'], $tree[0]->getGroupMemberSet());
}
@@ -77,15 +78,17 @@ class PluginUpdatePropertiesTest extends \PHPUnit_Framework_TestCase {
*/
function testSetBadValue() {
- $tree = array(
- new MockPrincipal('foo','foo'),
- );
+ $tree = [
+ new MockPrincipal('foo', 'foo'),
+ ];
$server = new DAV\Server($tree);
- $server->addPlugin(new Plugin());
+ $plugin = new Plugin();
+ $plugin->allowUnauthenticatedAccess = false;
+ $server->addPlugin($plugin);
- $result = $server->updateProperties('foo', array(
+ $result = $server->updateProperties('foo', [
'{DAV:}group-member-set' => new \StdClass(),
- ));
+ ]);
}
@@ -95,10 +98,12 @@ class PluginUpdatePropertiesTest extends \PHPUnit_Framework_TestCase {
new DAV\SimpleCollection('foo'),
];
$server = new DAV\Server($tree);
- $server->addPlugin(new Plugin());
+ $plugin = new Plugin();
+ $plugin->allowUnauthenticatedAccess = false;
+ $server->addPlugin($plugin);
$result = $server->updateProperties('foo', [
- '{DAV:}group-member-set' => new DAV\Xml\Property\Href(['/bar','/baz'],false),
+ '{DAV:}group-member-set' => new DAV\Xml\Property\Href(['/bar', '/baz'], false),
]);
$expected = [