aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-08-15 18:04:55 +0200
committerLouis Chemineau <louis@chmn.me>2024-08-28 10:27:14 +0200
commitb21a399d1a7fab83ff80bc637c176915d3460f2b (patch)
tree19bd20b2640275d01401a4c093aad1ae6b736b78 /apps/files/tests
parentcc091b150eb370f16d3c7a076d912b08878af96e (diff)
downloadnextcloud-server-b21a399d1a7fab83ff80bc637c176915d3460f2b.tar.gz
nextcloud-server-b21a399d1a7fab83ff80bc637c176915d3460f2b.zip
fix: implement sharding compatible cleanup for various bits
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/Command/DeleteOrphanedFilesTest.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/files/tests/Command/DeleteOrphanedFilesTest.php b/apps/files/tests/Command/DeleteOrphanedFilesTest.php
index e52f9e1e130..ed9a1866d26 100644
--- a/apps/files/tests/Command/DeleteOrphanedFilesTest.php
+++ b/apps/files/tests/Command/DeleteOrphanedFilesTest.php
@@ -64,13 +64,19 @@ class DeleteOrphanedFilesTest extends TestCase {
}
protected function getFile($fileId) {
- $stmt = $this->connection->executeQuery('SELECT * FROM `*PREFIX*filecache` WHERE `fileid` = ?', [$fileId]);
- return $stmt->fetchAll();
+ $query = $this->connection->getQueryBuilder();
+ $query->select('*')
+ ->from('filecache')
+ ->where($query->expr()->eq('fileid', $query->createNamedParameter($fileId)));
+ return $query->executeQuery()->fetchAll();
}
protected function getMounts($storageId) {
- $stmt = $this->connection->executeQuery('SELECT * FROM `*PREFIX*mounts` WHERE `storage_id` = ?', [$storageId]);
- return $stmt->fetchAll();
+ $query = $this->connection->getQueryBuilder();
+ $query->select('*')
+ ->from('mounts')
+ ->where($query->expr()->eq('storage_id', $query->createNamedParameter($storageId)));
+ return $query->executeQuery()->fetchAll();
}
/**