diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-19 10:10:19 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-19 10:10:19 +0200 |
commit | cc9b36131cf971f51d638501ef4da73c9fbedf18 (patch) | |
tree | f85000d79d6c8b05b03f68e163517a19f0849323 /apps/files/tests/Controller/ViewControllerTest.php | |
parent | 54f79a28f6650ec5cb4fbd9e152eb1d6fb0aa0cb (diff) | |
download | nextcloud-server-cc9b36131cf971f51d638501ef4da73c9fbedf18.tar.gz nextcloud-server-cc9b36131cf971f51d638501ef4da73c9fbedf18.zip |
When requesting a permalink to an invalid file redirect
We need to do the redirect to update address bar.
Diffstat (limited to 'apps/files/tests/Controller/ViewControllerTest.php')
-rw-r--r-- | apps/files/tests/Controller/ViewControllerTest.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index 0ffe66c5592..b4b4bfa92fc 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -348,10 +348,14 @@ class ViewControllerTest extends TestCase { ->with(123) ->will($this->returnValue([])); + $this->urlGenerator->expects($this->once()) + ->method('linkToRoute') + ->with('files.view.index', ['fileNotFound' => true]) + ->willReturn('redirect.url'); + $response = $this->viewController->index('MyDir', 'MyView', '123'); - $this->assertInstanceOf('OCP\AppFramework\Http\TemplateResponse', $response); - $params = $response->getParams(); - $this->assertEquals(1, $params['fileNotFound']); + $this->assertInstanceOf('OCP\AppFramework\Http\RedirectResponse', $response); + $this->assertEquals('redirect.url', $response->getRedirectURL()); } public function testShowFileRouteWithTrashedFile() { |