summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-08-12 15:18:30 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-14 20:35:33 +0200
commit80f054ddd347a7b828594d8a4c52fb79b7a89506 (patch)
treeff7eeb42e2012597a0e495789f40d787477cfeba /tests
parent63863271503384e124e39833d0598e8652d3a380 (diff)
downloadnextcloud-server-80f054ddd347a7b828594d8a4c52fb79b7a89506.tar.gz
nextcloud-server-80f054ddd347a7b828594d8a4c52fb79b7a89506.zip
also verify cache in dav upload tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/connector/sabre/requesttest/uploadtest.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/lib/connector/sabre/requesttest/uploadtest.php b/tests/lib/connector/sabre/requesttest/uploadtest.php
index 2cc912d07f2..b8cd44afda7 100644
--- a/tests/lib/connector/sabre/requesttest/uploadtest.php
+++ b/tests/lib/connector/sabre/requesttest/uploadtest.php
@@ -19,18 +19,26 @@ class UploadTest extends RequestTest {
$this->assertEquals(201, $response->getStatus());
$this->assertTrue($view->file_exists('foo.txt'));
$this->assertEquals('asd', $view->file_get_contents('foo.txt'));
+
+ $info = $view->getFileInfo('foo.txt');
+ $this->assertInstanceOf('\OC\Files\FileInfo', $info);
+ $this->assertEquals(3, $info->getSize());
}
public function testUploadOverWrite() {
$user = $this->getUniqueID();
$view = $this->setupUser($user, 'pass');
- $view->file_put_contents('foo.txt', 'bar');
+ $view->file_put_contents('foo.txt', 'foobar');
$response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt', 'asd');
$this->assertEquals(204, $response->getStatus());
$this->assertEquals('asd', $view->file_get_contents('foo.txt'));
+
+ $info = $view->getFileInfo('foo.txt');
+ $this->assertInstanceOf('\OC\Files\FileInfo', $info);
+ $this->assertEquals(3, $info->getSize());
}
public function testChunkedUpload() {
@@ -49,6 +57,10 @@ class UploadTest extends RequestTest {
$this->assertTrue($view->file_exists('foo.txt'));
$this->assertEquals('asdbar', $view->file_get_contents('foo.txt'));
+
+ $info = $view->getFileInfo('foo.txt');
+ $this->assertInstanceOf('\OC\Files\FileInfo', $info);
+ $this->assertEquals(6, $info->getSize());
}
public function testChunkedUploadOverWrite() {
@@ -66,6 +78,10 @@ class UploadTest extends RequestTest {
$this->assertEquals(201, $response->getStatus());
$this->assertEquals('asdbar', $view->file_get_contents('foo.txt'));
+
+ $info = $view->getFileInfo('foo.txt');
+ $this->assertInstanceOf('\OC\Files\FileInfo', $info);
+ $this->assertEquals(6, $info->getSize());
}
public function testChunkedUploadOutOfOrder() {
@@ -84,5 +100,9 @@ class UploadTest extends RequestTest {
$this->assertTrue($view->file_exists('foo.txt'));
$this->assertEquals('asdbar', $view->file_get_contents('foo.txt'));
+
+ $info = $view->getFileInfo('foo.txt');
+ $this->assertInstanceOf('\OC\Files\FileInfo', $info);
+ $this->assertEquals(6, $info->getSize());
}
}