aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/HttpPutTest.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/DAV/HttpPutTest.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/DAV/HttpPutTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/HttpPutTest.php111
1 files changed, 49 insertions, 62 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/HttpPutTest.php b/vendor/sabre/dav/tests/Sabre/DAV/HttpPutTest.php
index 86480b1c2..d3932a4c6 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/HttpPutTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/HttpPutTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAV;
use Sabre\DAVServerTest;
@@ -12,31 +14,28 @@ use Sabre\HTTP;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class HttpPutTest extends DAVServerTest {
-
+class HttpPutTest extends DAVServerTest
+{
/**
* Sets up the DAV tree.
- *
- * @return void
*/
- function setUpTree() {
-
+ public function setUpTree()
+ {
$this->tree = new Mock\Collection('root', [
'file1' => 'foo',
]);
-
}
/**
* A successful PUT of a new file.
*/
- function testPut() {
-
+ public function testPut()
+ {
$request = new HTTP\Request('PUT', '/file2', [], 'hello');
$response = $this->request($request);
- $this->assertEquals(201, $response->getStatus(), 'Incorrect status code received. Full response body:' . $response->getBodyAsString());
+ $this->assertEquals(201, $response->getStatus(), 'Incorrect status code received. Full response body:'.$response->getBodyAsString());
$this->assertEquals(
'hello',
@@ -46,12 +45,11 @@ class HttpPutTest extends DAVServerTest {
$this->assertEquals(
[
'X-Sabre-Version' => [Version::VERSION],
- 'Content-Length' => ['0'],
- 'ETag' => ['"' . md5('hello') . '"']
+ 'Content-Length' => ['0'],
+ 'ETag' => ['"'.md5('hello').'"'],
],
$response->getHeaders()
);
-
}
/**
@@ -59,8 +57,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testPutExisting() {
-
+ public function testPutExisting()
+ {
$request = new HTTP\Request('PUT', '/file1', [], 'bar');
$response = $this->request($request);
@@ -75,21 +73,20 @@ class HttpPutTest extends DAVServerTest {
$this->assertEquals(
[
'X-Sabre-Version' => [Version::VERSION],
- 'Content-Length' => ['0'],
- 'ETag' => ['"' . md5('bar') . '"']
+ 'Content-Length' => ['0'],
+ 'ETag' => ['"'.md5('bar').'"'],
],
$response->getHeaders()
);
-
}
/**
- * PUT on existing file with If-Match: *
+ * PUT on existing file with If-Match: *.
*
* @depends testPutExisting
*/
- function testPutExistingIfMatchStar() {
-
+ public function testPutExistingIfMatchStar()
+ {
$request = new HTTP\Request(
'PUT',
'/file1',
@@ -109,25 +106,24 @@ class HttpPutTest extends DAVServerTest {
$this->assertEquals(
[
'X-Sabre-Version' => [Version::VERSION],
- 'Content-Length' => ['0'],
- 'ETag' => ['"' . md5('hello') . '"']
+ 'Content-Length' => ['0'],
+ 'ETag' => ['"'.md5('hello').'"'],
],
$response->getHeaders()
);
-
}
/**
- * PUT on existing file with If-Match: with a correct etag
+ * PUT on existing file with If-Match: with a correct etag.
*
* @depends testPutExisting
*/
- function testPutExistingIfMatchCorrect() {
-
+ public function testPutExistingIfMatchCorrect()
+ {
$request = new HTTP\Request(
'PUT',
'/file1',
- ['If-Match' => '"' . md5('foo') . '"'],
+ ['If-Match' => '"'.md5('foo').'"'],
'hello'
);
@@ -143,12 +139,11 @@ class HttpPutTest extends DAVServerTest {
$this->assertEquals(
[
'X-Sabre-Version' => [Version::VERSION],
- 'Content-Length' => ['0'],
- 'ETag' => ['"' . md5('hello') . '"'],
+ 'Content-Length' => ['0'],
+ 'ETag' => ['"'.md5('hello').'"'],
],
$response->getHeaders()
);
-
}
/**
@@ -156,8 +151,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testPutContentRange() {
-
+ public function testPutContentRange()
+ {
$request = new HTTP\Request(
'PUT',
'/file2',
@@ -167,7 +162,6 @@ class HttpPutTest extends DAVServerTest {
$response = $this->request($request);
$this->assertEquals(400, $response->getStatus());
-
}
/**
@@ -175,8 +169,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testPutIfNoneMatchStar() {
-
+ public function testPutIfNoneMatchStar()
+ {
$request = new HTTP\Request(
'PUT',
'/file2',
@@ -196,12 +190,11 @@ class HttpPutTest extends DAVServerTest {
$this->assertEquals(
[
'X-Sabre-Version' => [Version::VERSION],
- 'Content-Length' => ['0'],
- 'ETag' => ['"' . md5('hello') . '"']
+ 'Content-Length' => ['0'],
+ 'ETag' => ['"'.md5('hello').'"'],
],
$response->getHeaders()
);
-
}
/**
@@ -209,8 +202,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testPutIfMatchStar() {
-
+ public function testPutIfMatchStar()
+ {
$request = new HTTP\Request(
'PUT',
'/file2',
@@ -221,7 +214,6 @@ class HttpPutTest extends DAVServerTest {
$response = $this->request($request);
$this->assertEquals(412, $response->getStatus());
-
}
/**
@@ -229,8 +221,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testPutExistingIfNoneMatchStar() {
-
+ public function testPutExistingIfNoneMatchStar()
+ {
$request = new HTTP\Request(
'PUT',
'/file1',
@@ -242,7 +234,6 @@ class HttpPutTest extends DAVServerTest {
$response = $this->request($request);
$this->assertEquals(412, $response->getStatus());
-
}
/**
@@ -250,8 +241,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testPutNoParent() {
-
+ public function testPutNoParent()
+ {
$request = new HTTP\Request(
'PUT',
'/file1/file2',
@@ -261,7 +252,6 @@ class HttpPutTest extends DAVServerTest {
$response = $this->request($request);
$this->assertEquals(409, $response->getStatus());
-
}
/**
@@ -271,8 +261,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testFinderPutSuccess() {
-
+ public function testFinderPutSuccess()
+ {
$request = new HTTP\Request(
'PUT',
'/file2',
@@ -291,12 +281,11 @@ class HttpPutTest extends DAVServerTest {
$this->assertEquals(
[
'X-Sabre-Version' => [Version::VERSION],
- 'Content-Length' => ['0'],
- 'ETag' => ['"' . md5('hello') . '"'],
+ 'Content-Length' => ['0'],
+ 'ETag' => ['"'.md5('hello').'"'],
],
$response->getHeaders()
);
-
}
/**
@@ -304,8 +293,8 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testFinderPutSuccess
*/
- function testFinderPutFail() {
-
+ public function testFinderPutFail()
+ {
$request = new HTTP\Request(
'PUT',
'/file2',
@@ -316,7 +305,6 @@ class HttpPutTest extends DAVServerTest {
$response = $this->request($request);
$this->assertEquals(403, $response->getStatus());
-
}
/**
@@ -324,17 +312,18 @@ class HttpPutTest extends DAVServerTest {
*
* @depends testPut
*/
- function testPutIntercept() {
-
- $this->server->on('beforeBind', function($uri) {
+ public function testPutIntercept()
+ {
+ $this->server->on('beforeBind', function ($uri) {
$this->server->httpResponse->setStatus(418);
+
return false;
});
$request = new HTTP\Request('PUT', '/file2', [], 'hello');
$response = $this->request($request);
- $this->assertEquals(418, $response->getStatus(), 'Incorrect status code received. Full response body: ' . $response->getBodyAsString());
+ $this->assertEquals(418, $response->getStatus(), 'Incorrect status code received. Full response body: '.$response->getBodyAsString());
$this->assertFalse(
$this->server->tree->nodeExists('file2')
@@ -343,7 +332,5 @@ class HttpPutTest extends DAVServerTest {
$this->assertEquals([
'X-Sabre-Version' => [Version::VERSION],
], $response->getHeaders());
-
}
-
}