diff options
-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()); } } |