From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- .../dav/tests/Sabre/DAVACL/BlockAccessTest.php | 131 ++++++++++----------- 1 file changed, 59 insertions(+), 72 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php index ceae9aed0..3c3aaf6c9 100644 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php @@ -1,19 +1,21 @@ server->getPlugin('auth')->beforeMethod( - new \Sabre\HTTP\Request(), + new \Sabre\HTTP\Request('GET', '/'), new \Sabre\HTTP\Response() ); $this->server->addPlugin($this->plugin); - } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testGet() { - + public function testGet() + { $this->server->httpRequest->setMethod('GET'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } - function testGetDoesntExist() { - + public function testGetDoesntExist() + { $this->server->httpRequest->setMethod('GET'); $this->server->httpRequest->setUrl('/foo'); - $r = $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); + $r = $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); $this->assertTrue($r); - } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testHEAD() { - + public function testHEAD() + { $this->server->httpRequest->setMethod('HEAD'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testOPTIONS() { - + public function testOPTIONS() + { $this->server->httpRequest->setMethod('OPTIONS'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testPUT() { - + public function testPUT() + { $this->server->httpRequest->setMethod('PUT'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testPROPPATCH() { - + public function testPROPPATCH() + { $this->server->httpRequest->setMethod('PROPPATCH'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testCOPY() { - + public function testCOPY() + { $this->server->httpRequest->setMethod('COPY'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testMOVE() { - + public function testMOVE() + { $this->server->httpRequest->setMethod('MOVE'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testACL() { - + public function testACL() + { $this->server->httpRequest->setMethod('ACL'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testLOCK() { - + public function testLOCK() + { $this->server->httpRequest->setMethod('LOCK'); $this->server->httpRequest->setUrl('/testdir'); - $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]); - + $this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse]); } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testBeforeBind() { - + public function testBeforeBind() + { $this->server->emit('beforeBind', ['testdir/file']); - } /** - * @expectedException Sabre\DAVACL\Exception\NeedPrivileges + * @expectedException \Sabre\DAVACL\Exception\NeedPrivileges */ - function testBeforeUnbind() { - + public function testBeforeUnbind() + { $this->server->emit('beforeUnbind', ['testdir']); - } - function testPropFind() { - + public function testPropFind() + { $propFind = new DAV\PropFind('testdir', [ '{DAV:}displayname', '{DAV:}getcontentlength', @@ -187,19 +176,18 @@ class BlockAccessTest extends \PHPUnit_Framework_TestCase { 200 => [], 404 => [], 403 => [ - '{DAV:}displayname' => null, + '{DAV:}displayname' => null, '{DAV:}getcontentlength' => null, - '{DAV:}bar' => null, - '{DAV:}owner' => null, + '{DAV:}bar' => null, + '{DAV:}owner' => null, ], ]; $this->assertEquals($expected, $propFind->getResultForMultiStatus()); - } - function testBeforeGetPropertiesNoListing() { - + public function testBeforeGetPropertiesNoListing() + { $this->plugin->hideNodesFromListings = true; $propFind = new DAV\PropFind('testdir', [ '{DAV:}displayname', @@ -210,6 +198,5 @@ class BlockAccessTest extends \PHPUnit_Framework_TestCase { $r = $this->server->emit('propFind', [$propFind, new DAV\SimpleCollection('testdir')]); $this->assertFalse($r); - } } -- cgit v1.2.3