diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-08-12 15:18:30 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-14 20:35:33 +0200 |
commit | 80f054ddd347a7b828594d8a4c52fb79b7a89506 (patch) | |
tree | ff7eeb42e2012597a0e495789f40d787477cfeba /tests | |
parent | 63863271503384e124e39833d0598e8652d3a380 (diff) | |
download | nextcloud-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.php | 22 |
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()); } } |