aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files
Commit message (Collapse)AuthorAgeFilesLines
* test: Fix coding standardsci/noid/update-phpunit10Joas Schilling10 days3-4/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* test: Fix non-static data providersJoas Schilling10 days4-16/+13
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* test: Fix tests/lib/FilesJoas Schilling10 days8-63/+64
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* test: Cleanup tests/lib/Files/*Joas Schilling10 days17-89/+99
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Merge pull request #48560 from nextcloud/fix/migrate-encryption-away-from-hooksCôme Chilliet11 days2-19/+20
|\ | | | | feat(encryption): Migrate from hooks to events
| * fix(encryption): Improve Update class and event listeneningCôme Chilliet12 days1-15/+0
| | | | | | | | | | | | to avoid back&forth between path and Node object Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * fix(tests): Disable encryption wrapper when it makes senseCôme Chilliet12 days1-0/+14
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * fix(tests): Remove Encryption disabling in ViewTest to avoid side effectsCôme Chilliet12 days1-10/+6
| | | | | | | | | | | | Adapt tests a bit to make them pass with Encryption wrapper registered Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * fix(tests): Unregister encryption modules in ViewTest to avoid side effectsCôme Chilliet12 days1-0/+6
| | | | | | | | | | | | It was clearing the hooks with the same results before Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Merge pull request #52775 from nextcloud/nested-jail-rootAndy Scherzinger11 days1-0/+11
|\ \ | |/ |/| fix unjailedroot of nested jails if there are other wrappers in between
| * test: add test for nested cache jail unjailedrootRobin Appelman12 days1-0/+11
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | feat(FilenameValidator): allow to sanitize filenamesfeat/ocp-sanitize-filenamesFerdinand Thiessen12 days1-0/+134
|/ | | | | | Share the filename sanitizing with the OCP filename validator. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* test: Finish migrating tests/Core/ to PHPUnit 10 compatible codetest/noid/more-phpunit-10Joas Schilling2025-05-024-86/+98
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Merge pull request #51020 from nextcloud/artonge/fix/transfer_ownershipLouis2025-04-141-0/+18
|\
| * fix: Transfer ownership with S3 as primaryartonge/fix/transfer_ownershipLouis Chemineau2025-04-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using S3 as primary storage, transferring ownership with the `--move` option fail with the following error: `SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8-45b963397aa40d4a0063e0d85e4fe7a1' for key 'fs_storage_path_hash'` The `--move` option moves the entire home folder from one account to another. The error means that the move failed because the destination folder already exist in `oc_filecache`. - With S3 as primary storage, folders only exists as entries in `oc_filecache`. - With S3 as primary storage, `moveFromStorage(...)` only moves the cache entry, as nothing needs to be moved on disk. This cache move does not delete potentially pre-existing destination folder. - With Local storage, `moveFromStorage(...)` calls `rename(...)` which delete pre-existing folder. - `transfer(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/apps/files/lib/Service/OwnershipTransferService.php#L112 - `oneTimeUserSetup(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/SetupManager.php#L261-L262 - `mkdir(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L91-L135 - `moveFromStorage(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L635-L636 Delete pre-existing folder in `moveFromStorage(...)` Signed-off-by: Louis Chemineau <louis@chmn.me>
* | fix: Replace all usages of OC_User backend method calls by IUserManagerfix/cleanup-user-backendsCôme Chilliet2025-04-103-4/+9
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(IFilenameValidator): correctly handle case insensitivityfix/file-name-validator-case-sensitivityFerdinand Thiessen2025-03-211-1/+91
| | | | | | | | - forbidden names and forbidden base names are case **insensitive** so we need to check all lowercase here. - add test that config value is also read case insensitive. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix: make sure we process mime extensions as stringskjnldsv2025-02-051-0/+35
| | | | Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
* fix: Harden files scanner for invalid null accessFerdinand Thiessen2025-01-282-5/+10
| | | | | | Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix: Metadata field searchartonge/fix/metadata_field_searchLouis Chemineau2025-01-201-2/+7
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* test: update test for mountpoint numeric storage idmountpoint-get-numeric-storage-id-cacheRobin Appelman2025-01-131-0/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: improve checks for moving shares/storages into other mountsRobin Appelman2025-01-031-9/+42
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: fix mimetype not being updated when changing file extention on object storeupdater-change-mimetype-objectstoreRobin Appelman2024-12-051-0/+35
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* test(View): Copy preserves contentLouis Chemineau2024-12-031-0/+8
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* fix(files): Correctly copy the cache information on copy operationsLouis Chemineau2024-12-031-0/+1
| | | | | | Needed to copy the `encrypted` flag of encrypted files when those files are two level down in a moved folder. Signed-off-by: Louis Chemineau <louis@chmn.me>
* fix: Wrap partial cache entry in CacheEntryartonge/fix/getting_cache_entryLouis Chemineau2024-11-211-3/+4
| | | | | | | | Because it is returned here: https://github.com/nextcloud/server/blob/7b7d07c5750583ab3a7b29112af475f5c8891143/lib/private/Files/Cache/Cache.php#L136-L137 And some implementation got stricter: https://github.com/nextcloud/groupfolders/blob/df95bf6ba807da5171de91108879b6d8aa9f3611/lib/Mount/RootEntryCache.php#L23-L28 Signed-off-by: Louis Chemineau <louis@chmn.me>
* Merge pull request #47847 from ↵John Molakvoæ2024-10-291-0/+23
|\ | | | | | | nextcloud/fix-copying-or-moving-from-shared-groupfolders
| * test: add test for nested jail cross-storage movefix-copying-or-moving-from-shared-groupfoldersRobin Appelman2024-10-101-0/+23
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | refactor(Storage): Align all Storage constructorsrefactor/storage/constructorsprovokateurin2024-10-232-5/+5
|/ | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* refactor(Storage): Make all parameter types strong typesprovokateurin2024-10-073-14/+12
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* refactor(Wrapper\Encryption): Migrate to strong typesrefactor/stream-encryption/typingsprovokateurin2024-10-071-109/+119
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* refactor(Stream\Encryption): Migrate to strong typesprovokateurin2024-10-071-26/+38
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* test: Fix IStorage return typesprovokateurin2024-09-264-10/+44
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix(tests): Pause trashbin for lock tests in ViewTest using rmdir and unlinkcleanup/event/trashbinCôme Chilliet2024-09-241-1/+16
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #48111 from ↵Côme Chilliet2024-09-231-1/+0
|\ | | | | | | | | nextcloud/fix/move-storage-constructor-to-specific-interface fix: Move storage constructor to specific interface
| * fix(tests): Fix test to remove call to non-existing constructorfix/move-storage-constructor-to-specific-interfaceCôme Chilliet2024-09-231-1/+0
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | fix(users): Don't crash if disabled user is missing in the databaseartonge/fix/prevent_missing_users_from_crashing_disabled_users_searchLouis Chemineau2024-09-233-5/+10
|/ | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-196-11/+11
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* test: put parent items into cache in testsRobin Appelman2024-09-184-50/+82
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* test: fix incorrect ltrim usage in testRobin Appelman2024-09-181-2/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(tests): Fix most obvious errors in ObjectStore testsCôme Chilliet2024-09-173-56/+60
| | | | | | Some are still failing Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(tests): Fix Folder testsCôme Chilliet2024-09-171-3/+22
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #47986 from cfiehe/fix_move_on_same_bucketStephan Orbaugh2024-09-173-0/+178
|\ | | | | perf(ObjectStoreStorage): Improve (slow) move on same object bucket
| * perf(ObjectStoreStorage): Improve (slow) move on same object bucketChristoph Fiehe2024-09-163-0/+178
| | | | | | | | | | | | | | | | | | This commit fixes the issue #47856. When you upload a file into a group folder and when you use a single S3 bucket as primary storage, the final move operation hangs for a long time. In the background, Nextcloud initiates a copy-delete sequence from the bucket into the bucket, with causes a lot unnecessary overhead. Nextcloud thinks that the file must be imported to another storage and does not recognize that everything is done on the same object bucket. In that case, the import step can be completely skipped, which saves time, network bandwidth and reduces the load on the object storage. The behavior improves a lot with https://github.com/nextcloud/server/pull/46013. However, there are still some put messages that are being sent to the object storage when you use an object storage as primary storage and upload files into a group folder. Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
* | fix: Fix other uses of removed Storage interfaceCôme Chilliet2024-09-162-2/+3
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | fix: Remove OCP\Files\Storage interface deprecated since version 9Côme Chilliet2024-09-163-13/+13
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-1565-546/+546
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* feat(db): switch from settype to castsfeat/switch-from-settype-to-castsAnna Larch2024-09-151-1/+1
| | | | Signed-off-by: Anna Larch <anna@nextcloud.com>
* fix(files): Check if the target path is a descendant of the shared folder pathGit'Fellow2024-09-051-1/+9
| | | | | | | | | | | | | | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: tests Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: fix tests Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: add tests Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: tests
* chore: adjust code to adhere to coding standardAnna Larch2024-09-051-1/+1
| | | | Signed-off-by: Anna Larch <anna@nextcloud.com>