aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/FSExt
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/FSExt')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php18
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php64
2 files changed, 40 insertions, 42 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php
index 3708594e0..f5d65a44f 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php
@@ -2,8 +2,6 @@
namespace Sabre\DAV\FSExt;
-use Sabre\DAV;
-
require_once 'Sabre/TestUtil.php';
class FileTest extends \PHPUnit_Framework_TestCase {
@@ -26,12 +24,12 @@ class FileTest extends \PHPUnit_Framework_TestCase {
$file = new File($filename);
$result = $file->put('New contents');
- $this->assertEquals('New contents',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
+ $this->assertEquals('New contents', file_get_contents(SABRE_TEMPDIR . '/file.txt'));
$this->assertEquals(
'"' .
sha1(
fileinode($filename) .
- filesize($filename ) .
+ filesize($filename) .
filemtime($filename)
) . '"',
$result
@@ -45,13 +43,13 @@ class FileTest extends \PHPUnit_Framework_TestCase {
$file->put('0000000');
$file->patch('111', 2, 3);
- $this->assertEquals('0001110',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
+ $this->assertEquals('0001110', file_get_contents(SABRE_TEMPDIR . '/file.txt'));
}
function testRangeStream() {
- $stream = fopen('php://memory','r+');
+ $stream = fopen('php://memory', 'r+');
fwrite($stream, "222");
rewind($stream);
@@ -59,7 +57,7 @@ class FileTest extends \PHPUnit_Framework_TestCase {
$file->put('0000000');
$file->patch($stream, 2, 3);
- $this->assertEquals('0002220',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
+ $this->assertEquals('0002220', file_get_contents(SABRE_TEMPDIR . '/file.txt'));
}
@@ -67,7 +65,7 @@ class FileTest extends \PHPUnit_Framework_TestCase {
function testGet() {
$file = new File(SABRE_TEMPDIR . '/file.txt');
- $this->assertEquals('Contents',stream_get_contents($file->get()));
+ $this->assertEquals('Contents', stream_get_contents($file->get()));
}
@@ -88,7 +86,7 @@ class FileTest extends \PHPUnit_Framework_TestCase {
'"' .
sha1(
fileinode($filename) .
- filesize($filename ) .
+ filesize($filename) .
filemtime($filename)
) . '"',
$file->getETag()
@@ -105,7 +103,7 @@ class FileTest extends \PHPUnit_Framework_TestCase {
function testGetSize() {
$file = new File(SABRE_TEMPDIR . '/file.txt');
- $this->assertEquals(8,$file->getSize());
+ $this->assertEquals(8, $file->getSize());
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php
index 63d858de1..20fca490a 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php
@@ -28,7 +28,7 @@ class ServerTest extends DAV\AbstractServer{
'Content-Type' => ['application/octet-stream'],
'Content-Length' => [13],
'Last-Modified' => [HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($filename)))],
- 'ETag' => ['"' . sha1(fileinode($filename ) . filesize($filename) . filemtime($filename)) . '"'],
+ 'ETag' => ['"' . sha1(fileinode($filename) . filesize($filename) . filemtime($filename)) . '"'],
],
$this->response->getHeaders()
);
@@ -50,12 +50,12 @@ class ServerTest extends DAV\AbstractServer{
'Content-Type' => ['application/octet-stream'],
'Content-Length' => [13],
'Last-Modified' => [HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt')))],
- 'ETag' => ['"' . sha1(fileinode($filename ) . filesize($filename) . filemtime($filename)) . '"'],
+ 'ETag' => ['"' . sha1(fileinode($filename) . filesize($filename) . filemtime($filename)) . '"'],
],
$this->response->getHeaders()
);
- $this->assertEquals(200,$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
}
@@ -71,12 +71,12 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Length' => ['0'],
- 'ETag' => ['"' . sha1(fileinode($filename ) . filesize($filename) . filemtime($filename)) . '"'],
+ 'ETag' => ['"' . sha1(fileinode($filename) . filesize($filename) . filemtime($filename)) . '"'],
], $this->response->getHeaders());
$this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
- $this->assertEquals('Testing new file',file_get_contents($filename));
+ $this->assertEquals('Testing new file', file_get_contents($filename));
}
@@ -89,11 +89,11 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Type' => ['application/xml; charset=utf-8'],
- ],$this->response->getHeaders());
+ 'Content-Type' => ['application/xml; charset=utf-8'],
+ ], $this->response->getHeaders());
$this->assertEquals(412, $this->response->status);
- $this->assertNotEquals('Testing new file',file_get_contents($this->tempDir . '/test.txt'));
+ $this->assertNotEquals('Testing new file', file_get_contents($this->tempDir . '/test.txt'));
}
@@ -105,8 +105,8 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Length' => ['0'],
- ],$this->response->getHeaders());
+ 'Content-Length' => ['0'],
+ ], $this->response->getHeaders());
$this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -125,7 +125,7 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
- $this->assertEquals('Testing updated file',file_get_contents($this->tempDir . '/test.txt'));
+ $this->assertEquals('Testing updated file', file_get_contents($this->tempDir . '/test.txt'));
}
@@ -137,8 +137,8 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Length' => ['0'],
- ],$this->response->getHeaders());
+ 'Content-Length' => ['0'],
+ ], $this->response->getHeaders());
$this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -148,8 +148,8 @@ class ServerTest extends DAV\AbstractServer{
function testDeleteDirectory() {
- mkdir($this->tempDir.'/testcol');
- file_put_contents($this->tempDir.'/testcol/test.txt','Hi! I\'m a file with a short lifespan');
+ mkdir($this->tempDir . '/testcol');
+ file_put_contents($this->tempDir . '/testcol/test.txt', 'Hi! I\'m a file with a short lifespan');
$request = new HTTP\Request('DELETE', '/testcol');
$this->server->httpRequest = ($request);
@@ -157,8 +157,8 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
- 'Content-Length' => ['0'],
- ],$this->response->getHeaders());
+ 'Content-Length' => ['0'],
+ ], $this->response->getHeaders());
$this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertFalse(file_exists($this->tempDir . '/testcol'));
@@ -172,12 +172,12 @@ class ServerTest extends DAV\AbstractServer{
$this->server->exec();
$this->assertEquals([
- 'DAV' => ['1, 3, extended-mkcol'],
- 'MS-Author-Via' => ['DAV'],
- 'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT'],
- 'Accept-Ranges' => ['bytes'],
- 'Content-Length' => ['0'],
- 'X-Sabre-Version'=> [DAV\Version::VERSION],
+ 'DAV' => ['1, 3, extended-mkcol'],
+ 'MS-Author-Via' => ['DAV'],
+ 'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT'],
+ 'Accept-Ranges' => ['bytes'],
+ 'Content-Length' => ['0'],
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
], $this->response->getHeaders());
$this->assertEquals(200, $this->response->status);
@@ -187,7 +187,7 @@ class ServerTest extends DAV\AbstractServer{
function testMove() {
- mkdir($this->tempDir.'/testcol');
+ mkdir($this->tempDir . '/testcol');
$request = new HTTP\Request('MOVE', '/test.txt', ['Destination' => '/testcol/test2.txt']);
$this->server->httpRequest = ($request);
@@ -197,9 +197,9 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals('', $this->response->body);
$this->assertEquals([
- 'Content-Length' => ['0'],
- 'X-Sabre-Version'=> [DAV\Version::VERSION],
- ],$this->response->getHeaders());
+ 'Content-Length' => ['0'],
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
+ ], $this->response->getHeaders());
$this->assertTrue(
is_file($this->tempDir . '/testcol/test2.txt')
@@ -217,8 +217,8 @@ class ServerTest extends DAV\AbstractServer{
*/
function testMoveOtherObject() {
- mkdir($this->tempDir.'/tree1');
- mkdir($this->tempDir.'/tree2');
+ mkdir($this->tempDir . '/tree1');
+ mkdir($this->tempDir . '/tree2');
$tree = new DAV\Tree(new DAV\SimpleCollection('root', [
new DAV\FS\Directory($this->tempDir . '/tree1'),
@@ -234,9 +234,9 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals('', $this->response->body);
$this->assertEquals([
- 'Content-Length' => ['0'],
- 'X-Sabre-Version'=> [DAV\Version::VERSION],
- ],$this->response->getHeaders());
+ 'Content-Length' => ['0'],
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
+ ], $this->response->getHeaders());
$this->assertTrue(
is_dir($this->tempDir . '/tree2/tree1')