aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-11-10 12:49:51 +0000
committerMario <mario@mariovavti.com>2019-11-10 14:10:03 +0100
commit580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch)
tree82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php
parentd22766f458a8539a40a57f3946459a9be1f21cd6 (diff)
downloadvolse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/BlockAccessTest.php131
1 files changed, 59 insertions, 72 deletions
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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL;
use Sabre\DAV;
-class BlockAccessTest extends \PHPUnit_Framework_TestCase {
-
+class BlockAccessTest extends \PHPUnit\Framework\TestCase
+{
/**
* @var DAV\Server
*/
protected $server;
protected $plugin;
- function setUp() {
-
+ public function setUp()
+ {
$nodes = [
new DAV\SimpleCollection('testdir'),
];
@@ -28,151 +30,138 @@ class BlockAccessTest extends \PHPUnit_Framework_TestCase {
);
// Login
$this->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);
-
}
}