aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/Browser
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/Browser')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php44
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php16
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php54
3 files changed, 57 insertions, 57 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php
index 157c2170a..54a3053ec 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php
@@ -11,8 +11,8 @@ class GuessContentTypeTest extends DAV\AbstractServer {
parent::setUp();
\Sabre\TestUtil::clearTempDir();
- file_put_contents(SABRE_TEMPDIR . '/somefile.jpg','blabla');
- file_put_contents(SABRE_TEMPDIR . '/somefile.hoi','blabla');
+ file_put_contents(SABRE_TEMPDIR . '/somefile.jpg', 'blabla');
+ file_put_contents(SABRE_TEMPDIR . '/somefile.hoi', 'blabla');
}
@@ -24,13 +24,13 @@ class GuessContentTypeTest extends DAV\AbstractServer {
function testGetProperties() {
- $properties = array(
+ $properties = [
'{DAV:}getcontenttype',
- );
- $result = $this->server->getPropertiesForPath('/somefile.jpg',$properties);
- $this->assertArrayHasKey(0,$result);
- $this->assertArrayHasKey(404,$result[0]);
- $this->assertArrayHasKey('{DAV:}getcontenttype',$result[0][404]);
+ ];
+ $result = $this->server->getPropertiesForPath('/somefile.jpg', $properties);
+ $this->assertArrayHasKey(0, $result);
+ $this->assertArrayHasKey(404, $result[0]);
+ $this->assertArrayHasKey('{DAV:}getcontenttype', $result[0][404]);
}
@@ -40,14 +40,14 @@ class GuessContentTypeTest extends DAV\AbstractServer {
function testGetPropertiesPluginEnabled() {
$this->server->addPlugin(new GuessContentType());
- $properties = array(
+ $properties = [
'{DAV:}getcontenttype',
- );
- $result = $this->server->getPropertiesForPath('/somefile.jpg',$properties);
- $this->assertArrayHasKey(0,$result);
- $this->assertArrayHasKey(200,$result[0], 'We received: ' . print_r($result,true));
- $this->assertArrayHasKey('{DAV:}getcontenttype',$result[0][200]);
- $this->assertEquals('image/jpeg',$result[0][200]['{DAV:}getcontenttype']);
+ ];
+ $result = $this->server->getPropertiesForPath('/somefile.jpg', $properties);
+ $this->assertArrayHasKey(0, $result);
+ $this->assertArrayHasKey(200, $result[0], 'We received: ' . print_r($result, true));
+ $this->assertArrayHasKey('{DAV:}getcontenttype', $result[0][200]);
+ $this->assertEquals('image/jpeg', $result[0][200]['{DAV:}getcontenttype']);
}
@@ -57,14 +57,14 @@ class GuessContentTypeTest extends DAV\AbstractServer {
function testGetPropertiesUnknown() {
$this->server->addPlugin(new GuessContentType());
- $properties = array(
+ $properties = [
'{DAV:}getcontenttype',
- );
- $result = $this->server->getPropertiesForPath('/somefile.hoi',$properties);
- $this->assertArrayHasKey(0,$result);
- $this->assertArrayHasKey(200,$result[0]);
- $this->assertArrayHasKey('{DAV:}getcontenttype',$result[0][200]);
- $this->assertEquals('application/octet-stream',$result[0][200]['{DAV:}getcontenttype']);
+ ];
+ $result = $this->server->getPropertiesForPath('/somefile.hoi', $properties);
+ $this->assertArrayHasKey(0, $result);
+ $this->assertArrayHasKey(200, $result[0]);
+ $this->assertArrayHasKey('{DAV:}getcontenttype', $result[0][200]);
+ $this->assertEquals('application/octet-stream', $result[0][200]['{DAV:}getcontenttype']);
}
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
index 9d9fbb319..33c4ede96 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
@@ -18,23 +18,23 @@ class MapGetToPropFindTest extends DAV\AbstractServer {
function testCollectionGet() {
- $serverVars = array(
+ $serverVars = [
'REQUEST_URI' => '/',
'REQUEST_METHOD' => 'GET',
- );
+ ];
$request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals(207, $this->response->status,'Incorrect status response received. Full response body: ' . $this->response->body);
- $this->assertEquals(array(
+ $this->assertEquals(207, $this->response->status, 'Incorrect status response received. Full response body: ' . $this->response->body);
+ $this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Type' => ['application/xml; charset=utf-8'],
- 'DAV' => ['1, 3, extended-mkcol'],
- 'Vary' => ['Brief,Prefer'],
- ),
+ 'Content-Type' => ['application/xml; charset=utf-8'],
+ 'DAV' => ['1, 3, extended-mkcol'],
+ 'Vary' => ['Brief,Prefer'],
+ ],
$this->response->getHeaders()
);
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php
index 00beea9f2..f20c50f86 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php
@@ -28,16 +28,16 @@ class PluginTest extends DAV\AbstractServer{
$this->assertEquals(200, $this->response->getStatus(), "Incorrect status received. Full response body: " . $this->response->getBodyAsString());
$this->assertEquals(
[
- 'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Type' => ['text/html; charset=utf-8'],
- 'Content-Security-Policy' => ["img-src 'self'; style-src 'self';"]
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
+ 'Content-Type' => ['text/html; charset=utf-8'],
+ 'Content-Security-Policy' => ["default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
],
$this->response->getHeaders()
);
$body = $this->response->getBodyAsString();
$this->assertTrue(strpos($body, '<title>dir') !== false, $body);
- $this->assertTrue(strpos($body, '<a href="/dir/child.txt">')!==false);
+ $this->assertTrue(strpos($body, '<a href="/dir/child.txt">') !== false);
}
@@ -54,16 +54,16 @@ class PluginTest extends DAV\AbstractServer{
$this->assertEquals(200, $this->response->getStatus(), "Incorrect status received. Full response body: " . $this->response->getBodyAsString());
$this->assertEquals(
[
- 'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Type' => ['text/html; charset=utf-8'],
- 'Content-Security-Policy' => ["img-src 'self'; style-src 'self';"]
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
+ 'Content-Type' => ['text/html; charset=utf-8'],
+ 'Content-Security-Policy' => ["default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
],
$this->response->getHeaders()
);
$body = $this->response->getBodyAsString();
$this->assertTrue(strpos($body, '<title>dir') !== false, $body);
- $this->assertTrue(strpos($body, '<a href="/dir/child.txt">')!==false);
+ $this->assertTrue(strpos($body, '<a href="/dir/child.txt">') !== false);
}
function testCollectionGetRoot() {
@@ -75,17 +75,17 @@ class PluginTest extends DAV\AbstractServer{
$this->assertEquals(200, $this->response->status, "Incorrect status received. Full response body: " . $this->response->getBodyAsString());
$this->assertEquals(
[
- 'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Type' => ['text/html; charset=utf-8'],
- 'Content-Security-Policy' => ["img-src 'self'; style-src 'self';"]
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
+ 'Content-Type' => ['text/html; charset=utf-8'],
+ 'Content-Security-Policy' => ["default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
],
$this->response->getHeaders()
);
$body = $this->response->getBodyAsString();
$this->assertTrue(strpos($body, '<title>/') !== false, $body);
- $this->assertTrue(strpos($body, '<a href="/dir/">')!==false);
- $this->assertTrue(strpos($body, '<span class="btn disabled">')!==false);
+ $this->assertTrue(strpos($body, '<a href="/dir/">') !== false);
+ $this->assertTrue(strpos($body, '<span class="btn disabled">') !== false);
}
@@ -122,15 +122,15 @@ class PluginTest extends DAV\AbstractServer{
function testPostMkCol() {
- $serverVars = array(
+ $serverVars = [
'REQUEST_URI' => '/',
'REQUEST_METHOD' => 'POST',
- 'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
- );
- $postVars = array(
+ 'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
+ ];
+ $postVars = [
'sabreAction' => 'mkcol',
- 'name' => 'new_collection',
- );
+ 'name' => 'new_collection',
+ ];
$request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setPostData($postVars);
@@ -138,10 +138,10 @@ class PluginTest extends DAV\AbstractServer{
$this->server->exec();
$this->assertEquals(302, $this->response->status);
- $this->assertEquals(array(
+ $this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Location' => ['/'],
- ), $this->response->getHeaders());
+ 'Location' => ['/'],
+ ], $this->response->getHeaders());
$this->assertTrue(is_dir(SABRE_TEMPDIR . '/new_collection'));
@@ -155,11 +155,11 @@ class PluginTest extends DAV\AbstractServer{
$this->assertEquals(200, $this->response->getStatus(), 'Error: ' . $this->response->body);
$this->assertEquals([
- 'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Type' => ['image/vnd.microsoft.icon'],
- 'Content-Length' => ['4286'],
- 'Cache-Control' => ['public, max-age=1209600'],
- 'Content-Security-Policy' => ["img-src 'self'; style-src 'self';"]
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
+ 'Content-Type' => ['image/vnd.microsoft.icon'],
+ 'Content-Length' => ['4286'],
+ 'Cache-Control' => ['public, max-age=1209600'],
+ 'Content-Security-Policy' => ["default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
], $this->response->getHeaders());
}