Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_texteditor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-05 13:54:31 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-05 13:58:25 +0300
commit7dc1d80fe40835f404dbb51875bca3ed1fe1b162 (patch)
tree1d14b53f212464785d0db1afe5f4da7a2995dde4 /tests
parent933551264bb9828c75f65f498c9ba3f843d5edd3 (diff)
Add unit test for too big files
Diffstat (limited to 'tests')
-rw-r--r--tests/controller/filehandlingcontrollertest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/controller/filehandlingcontrollertest.php b/tests/controller/filehandlingcontrollertest.php
index 8f9617b..59f75a3 100644
--- a/tests/controller/filehandlingcontrollertest.php
+++ b/tests/controller/filehandlingcontrollertest.php
@@ -177,6 +177,19 @@ class FileHandlingControllerTest extends TestCase {
}
+ public function testFileTooBig() {
+ $this->viewMock->expects($this->any())
+ ->method('filesize')
+ ->willReturn(4194304 + 1);
+
+ $result = $this->controller->load('/', 'foo.bar');
+ $data = $result->getData();
+ $status = $result->getStatus();
+ $this->assertSame(400, $status);
+ $this->assertArrayHasKey('message', $data);
+ $this->assertSame('The file is too big.', $data['message']);
+ }
+
public function dataTestSave() {
return array (
array('/test.txt', 'file content', 65638643, 65638643, true, 200, ''),