aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php
diff options
context:
space:
mode:
authorHilmar R <u02@u29lx193>2021-02-28 21:06:16 +0100
committerHilmar R <u02@u29lx193>2021-03-01 18:48:11 +0100
commitc26dede97f626b52b7bf8962ed55d1dbda86abe8 (patch)
tree3c8c9bc97aa09f7ce9afe9bf467cf87bbf2c7d0b /vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php
parentea3390d626f85b7293a750958bfd1b5460958365 (diff)
downloadvolse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.gz
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.bz2
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.zip
get dev
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php180
1 files changed, 0 insertions, 180 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php
deleted file mode 100644
index 566167ef0..000000000
--- a/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php
+++ /dev/null
@@ -1,180 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Sabre\DAVACL;
-
-use Sabre\DAV;
-
-class BlockAccessTest extends \PHPUnit\Framework\TestCase
-{
- /**
- * @var DAV\Server
- */
- protected $server;
- protected $plugin;
-
- public function setup(): void
- {
- $nodes = [
- new DAV\SimpleCollection('testdir'),
- ];
-
- $this->server = new DAV\Server($nodes);
- $this->plugin = new Plugin();
- $this->plugin->setDefaultAcl([]);
- $this->server->addPlugin(
- new DAV\Auth\Plugin(
- new DAV\Auth\Backend\Mock()
- )
- );
- // Login
- $this->server->getPlugin('auth')->beforeMethod(
- new \Sabre\HTTP\Request('GET', '/'),
- new \Sabre\HTTP\Response()
- );
- $this->server->addPlugin($this->plugin);
- }
-
- public function testGet()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('GET');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testGetDoesntExist()
- {
- $this->server->httpRequest->setMethod('GET');
- $this->server->httpRequest->setUrl('/foo');
-
- $r = $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- $this->assertTrue($r);
- }
-
- public function testHEAD()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('HEAD');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testOPTIONS()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('OPTIONS');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testPUT()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('PUT');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testPROPPATCH()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('PROPPATCH');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testCOPY()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('COPY');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testMOVE()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('MOVE');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testACL()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('ACL');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testLOCK()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->httpRequest->setMethod('LOCK');
- $this->server->httpRequest->setUrl('/testdir');
-
- $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]);
- }
-
- public function testBeforeBind()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->emit('beforeBind', ['testdir/file']);
- }
-
- public function testBeforeUnbind()
- {
- $this->expectException('Sabre\DAVACL\Exception\NeedPrivileges');
- $this->server->emit('beforeUnbind', ['testdir']);
- }
-
- public function testPropFind()
- {
- $propFind = new DAV\PropFind('testdir', [
- '{DAV:}displayname',
- '{DAV:}getcontentlength',
- '{DAV:}bar',
- '{DAV:}owner',
- ]);
-
- $r = $this->server->emit('propFind', [$propFind, new DAV\SimpleCollection('testdir')]);
- $this->assertTrue($r);
-
- $expected = [
- 200 => [],
- 404 => [],
- 403 => [
- '{DAV:}displayname' => null,
- '{DAV:}getcontentlength' => null,
- '{DAV:}bar' => null,
- '{DAV:}owner' => null,
- ],
- ];
-
- $this->assertEquals($expected, $propFind->getResultForMultiStatus());
- }
-
- public function testBeforeGetPropertiesNoListing()
- {
- $this->plugin->hideNodesFromListings = true;
- $propFind = new DAV\PropFind('testdir', [
- '{DAV:}displayname',
- '{DAV:}getcontentlength',
- '{DAV:}bar',
- '{DAV:}owner',
- ]);
-
- $r = $this->server->emit('propFind', [$propFind, new DAV\SimpleCollection('testdir')]);
- $this->assertFalse($r);
- }
-}