aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-07-15 14:49:38 +0200
committerRobin Appelman <robin@icewind.nl>2024-07-16 17:43:06 +0200
commit7046aac7c4d81c2783a129d0a6e9d5bb9cd50efc (patch)
treec75eeb63b782a63a199ea91725bfc35966157d4a /apps/files_sharing/tests
parentdecae5a45a93e0c16f748f38151575f8eb108d76 (diff)
downloadnextcloud-server-7046aac7c4d81c2783a129d0a6e9d5bb9cd50efc.tar.gz
nextcloud-server-7046aac7c4d81c2783a129d0a6e9d5bb9cd50efc.zip
test: update share tests to work with sharding
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
index fae07bccfa7..803ee1d02c9 100644
--- a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
+++ b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
@@ -54,48 +54,48 @@ class CleanupRemoteStoragesTest extends TestCase {
$storageQuery = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$storageQuery->insert('storages')
- ->setValue('id', '?');
+ ->setValue('id', $storageQuery->createParameter('id'));
$shareExternalQuery = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$shareExternalQuery->insert('share_external')
- ->setValue('share_token', '?')
- ->setValue('remote', '?')
- ->setValue('name', '?')
- ->setValue('owner', '?')
- ->setValue('user', '?')
- ->setValue('mountpoint', '?')
- ->setValue('mountpoint_hash', '?');
+ ->setValue('share_token', $shareExternalQuery->createParameter('share_token'))
+ ->setValue('remote', $shareExternalQuery->createParameter('remote'))
+ ->setValue('name', $shareExternalQuery->createParameter('name'))
+ ->setValue('owner', $shareExternalQuery->createParameter('owner'))
+ ->setValue('user', $shareExternalQuery->createParameter('user'))
+ ->setValue('mountpoint', $shareExternalQuery->createParameter('mountpoint'))
+ ->setValue('mountpoint_hash', $shareExternalQuery->createParameter('mountpoint_hash'));
$filesQuery = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$filesQuery->insert('filecache')
- ->setValue('storage', '?')
- ->setValue('path', '?')
- ->setValue('path_hash', '?');
+ ->setValue('storage', $filesQuery->createParameter('storage'))
+ ->setValue('path', $filesQuery->createParameter('path'))
+ ->setValue('path_hash', $filesQuery->createParameter('path_hash'));
foreach ($this->storages as &$storage) {
if (isset($storage['id'])) {
- $storageQuery->setParameter(0, $storage['id']);
+ $storageQuery->setParameter('id', $storage['id']);
$storageQuery->execute();
$storage['numeric_id'] = $storageQuery->getLastInsertId();
}
if (isset($storage['share_token'])) {
$shareExternalQuery
- ->setParameter(0, $storage['share_token'])
- ->setParameter(1, $storage['remote'])
- ->setParameter(2, 'irrelevant')
- ->setParameter(3, 'irrelevant')
- ->setParameter(4, $storage['user'])
- ->setParameter(5, 'irrelevant')
- ->setParameter(6, 'irrelevant');
+ ->setParameter('share_token', $storage['share_token'])
+ ->setParameter('remote', $storage['remote'])
+ ->setParameter('name', 'irrelevant')
+ ->setParameter('owner', 'irrelevant')
+ ->setParameter('user', $storage['user'])
+ ->setParameter('mountpoint', 'irrelevant')
+ ->setParameter('mountpoint_hash', 'irrelevant');
$shareExternalQuery->executeStatement();
}
if (isset($storage['files_count'])) {
for ($i = 0; $i < $storage['files_count']; $i++) {
- $filesQuery->setParameter(0, $storage['numeric_id']);
- $filesQuery->setParameter(1, 'file' . $i);
- $filesQuery->setParameter(2, md5('file' . $i));
+ $filesQuery->setParameter('storage', $storage['numeric_id']);
+ $filesQuery->setParameter('path', 'file' . $i);
+ $filesQuery->setParameter('path_hash', md5('file' . $i));
$filesQuery->executeStatement();
}
}