Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Redirection now only happens when dir is empty
Otherwise dir it's just ignored and fileid is used

Signed-off-by: Carl Schwan <[email protected]>
  • Loading branch information
CarlSchwan committed Feb 21, 2022
commit 740a737f9421b3bc4b3fa06ff7ca5dd3c4104572
8 changes: 4 additions & 4 deletions apps/files/tests/Controller/ViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ public function testShowFileRouteWithFolder() {
->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() {
Expand Down Expand Up @@ -499,7 +499,7 @@ public function testShowFileRouteWithFile() {
->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() {
Expand All @@ -519,7 +519,7 @@ public function testShowFileRouteWithInvalidFileId() {
->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());
}
Expand Down Expand Up @@ -576,6 +576,6 @@ public function testShowFileRouteWithTrashedFile() {
->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'));
}
}