diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-05 13:54:31 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-05 13:58:25 +0300 |
commit | 7dc1d80fe40835f404dbb51875bca3ed1fe1b162 (patch) | |
tree | 1d14b53f212464785d0db1afe5f4da7a2995dde4 /tests | |
parent | 933551264bb9828c75f65f498c9ba3f843d5edd3 (diff) |
Add unit test for too big files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/controller/filehandlingcontrollertest.php | 13 |
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, ''), |