From 0cd4c3410121b9b584dc1b108e555832843b2576 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 15 Feb 2021 18:35:40 +0000 Subject: compser update sabre/dav /vobject --- .../sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php | 311 --------------------- 1 file changed, 311 deletions(-) delete mode 100644 vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php deleted file mode 100644 index 715559df3..000000000 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php +++ /dev/null @@ -1,311 +0,0 @@ -expectException('Sabre\DAV\Exception\BadRequest'); - $acl = new Plugin(); - $server = new DAV\Server(); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpAcl($server->httpRequest, $server->httpResponse); - } - - /** - /** - */ - public function testNotSupportedByNode() - { - $this->expectException('Sabre\DAV\Exception\MethodNotAllowed'); - $tree = [ - new DAV\SimpleCollection('test'), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('GET', '/'); - $body = ' - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testSuccessSimple() - { - $tree = [ - new MockACLNode('test', []), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('GET', '/'); - $server->httpRequest->setUrl('/test'); - - $body = ' - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $this->assertFalse($acl->httpACL($server->httpRequest, $server->httpResponse)); - } - - public function testUnrecognizedPrincipal() - { - $this->expectException('Sabre\DAVACL\Exception\NotRecognizedPrincipal'); - $tree = [ - new MockACLNode('test', []), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/notfound - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testUnrecognizedPrincipal2() - { - $this->expectException('Sabre\DAVACL\Exception\NotRecognizedPrincipal'); - $tree = [ - new MockACLNode('test', []), - new DAV\SimpleCollection('principals', [ - new DAV\SimpleCollection('notaprincipal'), - ]), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/notaprincipal - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testUnknownPrivilege() - { - $this->expectException('Sabre\DAVACL\Exception\NotSupportedPrivilege'); - $tree = [ - new MockACLNode('test', []), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/notfound - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testAbstractPrivilege() - { - $this->expectException('Sabre\DAVACL\Exception\NoAbstract'); - $tree = [ - new MockACLNode('test', []), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->on('getSupportedPrivilegeSet', function ($node, &$supportedPrivilegeSet) { - $supportedPrivilegeSet['{DAV:}foo'] = ['abstract' => true]; - }); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/foo/ - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testUpdateProtectedPrivilege() - { - $this->expectException('Sabre\DAVACL\Exception\AceConflict'); - $oldACL = [ - [ - 'principal' => 'principals/notfound', - 'privilege' => '{DAV:}write', - 'protected' => true, - ], - ]; - - $tree = [ - new MockACLNode('test', $oldACL), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/notfound - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testUpdateProtectedPrivilege2() - { - $this->expectException('Sabre\DAVACL\Exception\AceConflict'); - $oldACL = [ - [ - 'principal' => 'principals/notfound', - 'privilege' => '{DAV:}write', - 'protected' => true, - ], - ]; - - $tree = [ - new MockACLNode('test', $oldACL), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/foo - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testUpdateProtectedPrivilege3() - { - $this->expectException('Sabre\DAVACL\Exception\AceConflict'); - $oldACL = [ - [ - 'principal' => 'principals/notfound', - 'privilege' => '{DAV:}write', - 'protected' => true, - ], - ]; - - $tree = [ - new MockACLNode('test', $oldACL), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/notfound - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $acl->httpACL($server->httpRequest, $server->httpResponse); - } - - public function testSuccessComplex() - { - $oldACL = [ - [ - 'principal' => 'principals/foo', - 'privilege' => '{DAV:}write', - 'protected' => true, - ], - [ - 'principal' => 'principals/bar', - 'privilege' => '{DAV:}read', - ], - ]; - - $tree = [ - $node = new MockACLNode('test', $oldACL), - new DAV\SimpleCollection('principals', [ - new MockPrincipal('foo', 'principals/foo'), - new MockPrincipal('baz', 'principals/baz'), - ]), - ]; - $acl = new Plugin(); - $server = new DAV\Server($tree); - $server->httpRequest = new HTTP\Request('ACL', '/test'); - $body = ' - - - - /principals/foo - - - - - /principals/baz - -'; - $server->httpRequest->setBody($body); - $server->addPlugin(new DAV\Auth\Plugin()); - $server->addPlugin($acl); - - $this->assertFalse($acl->httpAcl($server->httpRequest, $server->httpResponse)); - - $this->assertEquals([ - [ - 'principal' => 'principals/foo', - 'privilege' => '{DAV:}write', - 'protected' => true, - ], - [ - 'principal' => 'principals/baz', - 'privilege' => '{DAV:}write', - 'protected' => false, - ], - ], $node->getACL()); - } -} -- cgit v1.2.3