aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests/Controller/ViewControllerTest.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-06-09 15:01:57 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-06-09 15:01:57 +0200
commitfc3ad7d5f7acb018329b22d5120c03cd07feecd6 (patch)
treeefa1958da450eb72ae93bb54dd3fe23a21aba682 /apps/files/tests/Controller/ViewControllerTest.php
parentb928305bb30ade5635a203408090f4ae376278ba (diff)
parentbb67acff9137a96f8ed002da6c8edf7aae8a7ec8 (diff)
downloadnextcloud-server-fc3ad7d5f7acb018329b22d5120c03cd07feecd6.tar.gz
nextcloud-server-fc3ad7d5f7acb018329b22d5120c03cd07feecd6.zip
Merge pull request #25 from nextcloud/downstream-160608
Downstream 2016-06-08
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']);
}
}