From 66effbfe0827fc61fff6d248797a894213ad20d6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 28 May 2016 17:46:24 +0200 Subject: upgrade to sabre32 --- .../dav/tests/Sabre/DAVACL/AllowAccessTest.php | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php index 14a80003a..f16693625 100644 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAVACL/AllowAccessTest.php @@ -3,7 +3,6 @@ namespace Sabre\DAVACL; use Sabre\DAV; -use Sabre\HTTP; class AllowAccessTest extends \PHPUnit_Framework_TestCase { @@ -14,13 +13,24 @@ class AllowAccessTest extends \PHPUnit_Framework_TestCase { function setUp() { - $nodes = array( - new DAV\SimpleCollection('testdir'), - ); + $nodes = [ + new DAV\Mock\Collection('testdir', [ + 'file1.txt' => 'contents', + ]), + ]; $this->server = new DAV\Server($nodes); + $this->server->addPlugin( + new DAV\Auth\Plugin( + new DAV\Auth\Backend\Mock() + ) + ); + // Login + $this->server->getPlugin('auth')->beforeMethod( + new \Sabre\HTTP\Request(), + new \Sabre\HTTP\Response() + ); $aclPlugin = new Plugin(); - $aclPlugin->allowAccessToNodesWithoutACL = true; $this->server->addPlugin($aclPlugin); } @@ -64,16 +74,7 @@ class AllowAccessTest extends \PHPUnit_Framework_TestCase { function testPUT() { $this->server->httpRequest->setMethod('PUT'); - $this->server->httpRequest->setUrl('/testdir'); - - $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); - - } - - function testACL() { - - $this->server->httpRequest->setMethod('ACL'); - $this->server->httpRequest->setUrl('/testdir'); + $this->server->httpRequest->setUrl('/testdir/file1.txt'); $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse])); -- cgit v1.2.3