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) --- vendor/sabre/dav/tests/Sabre/DAVServerTest.php | 70 ++++++++++++-------------- 1 file changed, 32 insertions(+), 38 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAVServerTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAVServerTest.php b/vendor/sabre/dav/tests/Sabre/DAVServerTest.php index 35f240d23..982090d23 100644 --- a/vendor/sabre/dav/tests/Sabre/DAVServerTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAVServerTest.php @@ -1,10 +1,11 @@ initializeEverything(); - } - function initializeEverything() { - + public function initializeEverything() + { $this->setUpBackends(); $this->setUpTree(); @@ -173,7 +173,6 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase { $this->aclPlugin->adminPrincipals = ['principals/admin']; $this->server->addPlugin($this->aclPlugin); } - } /** @@ -187,11 +186,12 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase { * the test. * * @param array|\Sabre\HTTP\Request $request - * @param int $expectedStatus + * @param int $expectedStatus + * * @return \Sabre\HTTP\Response */ - function request($request, $expectedStatus = null) { - + public function request($request, $expectedStatus = null) + { if (is_array($request)) { $request = HTTP\Request::createFromServerArray($request); } @@ -203,10 +203,10 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase { if ($expectedStatus) { $responseBody = $expectedStatus !== $response->getStatus() ? $response->getBodyAsString() : ''; - $this->assertEquals($expectedStatus, $response->getStatus(), 'Incorrect HTTP status received for request. Response body: ' . $responseBody); + $this->assertEquals($expectedStatus, $response->getStatus(), 'Incorrect HTTP status received for request. Response body: '.$responseBody); } - return $this->server->httpResponse; + return $this->server->httpResponse; } /** @@ -215,9 +215,10 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase { * * @param string $userName */ - function autoLogin($userName) { + public function autoLogin($userName) + { $authBackend = new DAV\Auth\Backend\Mock(); - $authBackend->setPrincipal('principals/' . $userName); + $authBackend->setPrincipal('principals/'.$userName); $this->authPlugin = new DAV\Auth\Plugin($authBackend); // If the auth plugin already exists, we're removing its hooks: @@ -227,14 +228,14 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase { $this->server->addPlugin($this->authPlugin); // This will trigger the actual login procedure - $this->authPlugin->beforeMethod(new Request(), new Response()); + $this->authPlugin->beforeMethod(new Request('GET', '/'), new Response()); } /** * Override this to provide your own Tree for your test-case. */ - function setUpTree() { - + public function setUpTree() + { if ($this->setupCalDAV) { $this->tree[] = new CalDAV\CalendarRoot( $this->principalBackend, @@ -258,15 +259,12 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase { ); } if ($this->setupFiles) { - $this->tree[] = new DAV\Mock\Collection('files'); - } - } - function setUpBackends() { - + public function setUpBackends() + { if ($this->setupCalDAVSharing && is_null($this->caldavBackend)) { $this->caldavBackend = new CalDAV\Backend\MockSharing($this->caldavCalendars, $this->caldavCalendarObjects); } @@ -289,18 +287,14 @@ abstract class DAVServerTest extends \PHPUnit_Framework_TestCase { if ($this->setupLocks) { $this->locksBackend = new DAV\Locks\Backend\Mock(); } - if ($this->setupPropertyStorage) { + if ($this->setupPropertyStorage) { $this->propertyStorageBackend = new DAV\PropertyStorage\Backend\Mock(); } - } - - function assertHttpStatus($expectedStatus, HTTP\Request $req) { - + public function assertHttpStatus($expectedStatus, HTTP\Request $req) + { $resp = $this->request($req); - $this->assertEquals((int)$expectedStatus, (int)$resp->status, 'Incorrect HTTP status received: ' . $resp->body); - + $this->assertEquals((int) $expectedStatus, (int) $resp->status, 'Incorrect HTTP status received: '.$resp->body); } - } -- cgit v1.2.3