diff options
author | Mario <mario@mariovavti.com> | 2019-12-04 10:25:11 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-12-04 10:25:11 +0000 |
commit | bde429cff649237984903a252ba1a718e6d74f53 (patch) | |
tree | b2b2570159cfb37689e6ce3b96c3b1b988d676cc /vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php | |
parent | cc9f41df5f83bcab435d6fb941b5a8f5b1457037 (diff) | |
parent | 4c8d33d1eb2a804aa70a7bc677d6c73d0d94816b (diff) | |
download | volse-hubzilla-bde429cff649237984903a252ba1a718e6d74f53.tar.gz volse-hubzilla-bde429cff649237984903a252ba1a718e6d74f53.tar.bz2 volse-hubzilla-bde429cff649237984903a252ba1a718e6d74f53.zip |
Merge branch '4.6RC'4.6
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php | 88 |
1 files changed, 38 insertions, 50 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php index f16693625..724abc685 100644 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php @@ -1,18 +1,20 @@ <?php +declare(strict_types=1); + namespace Sabre\DAVACL; use Sabre\DAV; -class AllowAccessTest extends \PHPUnit_Framework_TestCase { - +class AllowAccessTest extends \PHPUnit\Framework\TestCase +{ /** * @var DAV\Server */ protected $server; - function setUp() { - + public function setUp() + { $nodes = [ new DAV\Mock\Collection('testdir', [ 'file1.txt' => 'contents', @@ -27,106 +29,92 @@ class AllowAccessTest extends \PHPUnit_Framework_TestCase { ); // Login $this->server->getPlugin('auth')->beforeMethod( - new \Sabre\HTTP\Request(), + new \Sabre\HTTP\Request('GET', '/'), new \Sabre\HTTP\Response() ); $aclPlugin = new Plugin(); $this->server->addPlugin($aclPlugin); - } - function testGet() { - + public function testGet() + { $this->server->httpRequest->setMethod('GET'); $this->server->httpRequest->setUrl('/testdir'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($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'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:GET', [$this->server->httpRequest, $this->server->httpResponse])); } - function testHEAD() { - + public function testHEAD() + { $this->server->httpRequest->setMethod('HEAD'); $this->server->httpRequest->setUrl('/testdir'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:HEAD', [$this->server->httpRequest, $this->server->httpResponse])); } - function testOPTIONS() { - + public function testOPTIONS() + { $this->server->httpRequest->setMethod('OPTIONS'); $this->server->httpRequest->setUrl('/testdir'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:OPTIONS', [$this->server->httpRequest, $this->server->httpResponse])); } - function testPUT() { - + public function testPUT() + { $this->server->httpRequest->setMethod('PUT'); $this->server->httpRequest->setUrl('/testdir/file1.txt'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:PUT', [$this->server->httpRequest, $this->server->httpResponse])); } - function testPROPPATCH() { - + public function testPROPPATCH() + { $this->server->httpRequest->setMethod('PROPPATCH'); $this->server->httpRequest->setUrl('/testdir'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:PROPPATCH', [$this->server->httpRequest, $this->server->httpResponse])); } - function testCOPY() { - + public function testCOPY() + { $this->server->httpRequest->setMethod('COPY'); $this->server->httpRequest->setUrl('/testdir'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:COPY', [$this->server->httpRequest, $this->server->httpResponse])); } - function testMOVE() { - + public function testMOVE() + { $this->server->httpRequest->setMethod('MOVE'); $this->server->httpRequest->setUrl('/testdir'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:MOVE', [$this->server->httpRequest, $this->server->httpResponse])); } - function testLOCK() { - + public function testLOCK() + { $this->server->httpRequest->setMethod('LOCK'); $this->server->httpRequest->setUrl('/testdir'); - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - + $this->assertTrue($this->server->emit('beforeMethod:LOCK', [$this->server->httpRequest, $this->server->httpResponse])); } - function testBeforeBind() { - + public function testBeforeBind() + { $this->assertTrue($this->server->emit('beforeBind', ['testdir/file'])); - } - - function testBeforeUnbind() { - + public function testBeforeUnbind() + { $this->assertTrue($this->server->emit('beforeUnbind', ['testdir'])); - } - } |