From 9bc0e01d2453a812a5c4b84289dbafc72bf5c45e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 21 Feb 2022 11:35:22 +0100 Subject: Redirection now only happens when dir is empty Otherwise dir it's just ignored and fileid is used Signed-off-by: Carl Schwan --- apps/files/tests/Controller/ViewControllerTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files') diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index d7b298d9e84..33467f1464b 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -459,7 +459,7 @@ class ViewControllerTest extends TestCase { ->willReturn('/apps/files/?dir=/test/sub'); $expected = new Http\RedirectResponse('/apps/files/?dir=/test/sub'); - $this->assertEquals($expected, $this->viewController->index('/whatever', '', '123')); + $this->assertEquals($expected, $this->viewController->index('', '', '123')); } public function testShowFileRouteWithFile() { @@ -499,7 +499,7 @@ class ViewControllerTest extends TestCase { ->willReturn('/apps/files/?dir=/test/sub&scrollto=somefile.txt'); $expected = new Http\RedirectResponse('/apps/files/?dir=/test/sub&scrollto=somefile.txt'); - $this->assertEquals($expected, $this->viewController->index('/whatever', '', '123')); + $this->assertEquals($expected, $this->viewController->index('', '', '123')); } public function testShowFileRouteWithInvalidFileId() { @@ -519,7 +519,7 @@ class ViewControllerTest extends TestCase { ->with('files.view.index', ['fileNotFound' => true]) ->willReturn('redirect.url'); - $response = $this->viewController->index('MyDir', 'MyView', '123'); + $response = $this->viewController->index('', 'MyView', '123'); $this->assertInstanceOf('OCP\AppFramework\Http\RedirectResponse', $response); $this->assertEquals('redirect.url', $response->getRedirectURL()); } @@ -576,6 +576,6 @@ class ViewControllerTest extends TestCase { ->willReturn('/apps/files/?view=trashbin&dir=/test.d1462861890/sub&scrollto=somefile.txt'); $expected = new Http\RedirectResponse('/apps/files/?view=trashbin&dir=/test.d1462861890/sub&scrollto=somefile.txt'); - $this->assertEquals($expected, $this->viewController->index('/whatever', '', '123')); + $this->assertEquals($expected, $this->viewController->index('', '', '123')); } } -- cgit v1.2.3