aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller/PreviewControllerTest.php
Commit message (Collapse)AuthorAgeFilesLines
* fix: Adjust preview for view-only sharesfix/view-only-previewFerdinand Thiessen2024-10-281-17/+174
| | | | | | | | | | | | | | | | | Previously there was a different behavior for public shares (link-shares) and internal shares, if the user disabled the view permission. The legacy UI for public shares simply "disabled" the context menu and hided all download actions. With Nextcloud 31 all share types use the consistent permissions attributes, which simplifies code, but caused a regression: Images can no longer been viewed. Because on 30 and before the attribute was not set, previews for view-only files were still allowed. Now with 31 we need a new way to allow "viewing" shares. So this is allowing previews for those files, but only for internal usage. This is done by settin a special header, which only works with custom requests, and not by opening the URL directly. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-151-9/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix: Ignore preview requests for invalid file idsJulius Härtl2024-07-221-0/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* chore: Add SPDX headerAndy Scherzinger2024-05-131-19/+2
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(tests): preview phpunitJohn Molakvoæ2023-08-171-2/+2
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* composer run cs:fixCôme Chilliet2023-01-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Check share attributes on preview endpointsJulius Härtl2022-10-251-0/+9
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Fix tests and avoid PHP errors in themCôme Chilliet2021-11-231-0/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-121-3/+3
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Mode to modern phpunitRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-221-0/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add cache 1 day cache to preview endpointRoeland Jago Douma2016-11-031-3/+6
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* More testsRoeland Jago Douma2016-11-031-0/+223
* PreviewController test * PublicPreview test * Versions Preview test * Trash Preview test Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>