summaryrefslogtreecommitdiffstats
path: root/apps/files/tests/Controller/ViewControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/tests/Controller/ViewControllerTest.php')
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index 049f44fc0af..34c40ecea5c 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -26,6 +26,7 @@ namespace OCA\Files\Tests\Controller;
use OCA\Files\Controller\ViewController;
use OCP\AppFramework\Http;
+use OCP\Files\NotFoundException;
use OCP\IUser;
use OCP\Template;
use Test\TestCase;
@@ -259,7 +260,8 @@ class ViewControllerTest extends TestCase {
'isPublic' => false,
'defaultFileSorting' => 'name',
'defaultFileSortingDirection' => 'asc',
- 'showHiddenFiles' => false,
+ 'showHiddenFiles' => 0,
+ 'fileNotFound' => 0,
'mailNotificationEnabled' => 'no',
'mailPublicNotificationEnabled' => 'no',
'allowShareWithLink' => 'yes',
@@ -410,11 +412,14 @@ class ViewControllerTest extends TestCase {
->with(123)
->will($this->returnValue([]));
- $expected = new Http\NotFoundResponse();
if ($useShowFile) {
- $this->assertEquals($expected, $this->viewController->showFile(123));
+ $this->setExpectedException('OCP\Files\NotFoundException');
+ $this->viewController->showFile(123);
} else {
- $this->assertEquals($expected, $this->viewController->index('/whatever', '', '123'));
+ $response = $this->viewController->index('MyDir', 'MyView', '123');
+ $this->assertInstanceOf('OCP\AppFramework\Http\TemplateResponse', $response);
+ $params = $response->getParams();
+ $this->assertEquals(1, $params['fileNotFound']);
}
}