aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/Command
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-06-01 07:51:04 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-23 09:08:08 +0200
commit26c734abe4a5a524870a4ec95064958635eea888 (patch)
treeaf5b5ce449c46a386232d80033466323017dcc40 /apps/files_sharing/tests/Command
parentc9a197e6dd699942b0cf36504ff1fa5f5ef26893 (diff)
downloadnextcloud-server-26c734abe4a5a524870a4ec95064958635eea888.tar.gz
nextcloud-server-26c734abe4a5a524870a4ec95064958635eea888.zip
fix(tests): Specify all positional parameters again to fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing/tests/Command')
-rw-r--r--apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
index cc7fcabe5ac..5738610d0a5 100644
--- a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
+++ b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
@@ -79,11 +79,11 @@ class CleanupRemoteStoragesTest extends TestCase {
$shareExternalQuery->insert('share_external')
->setValue('share_token', '?')
->setValue('remote', '?')
- ->setValue('name', '?')->setParameter(2, 'irrelevant')
- ->setValue('owner', '?')->setParameter(3, 'irrelevant')
+ ->setValue('name', '?')
+ ->setValue('owner', '?')
->setValue('user', '?')
- ->setValue('mountpoint', '?')->setParameter(5, 'irrelevant')
- ->setValue('mountpoint_hash', '?')->setParameter(6, 'irrelevant');
+ ->setValue('mountpoint', '?')
+ ->setValue('mountpoint_hash', '?');
$filesQuery = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$filesQuery->insert('filecache')
@@ -95,15 +95,19 @@ class CleanupRemoteStoragesTest extends TestCase {
if (isset($storage['id'])) {
$storageQuery->setParameter(0, $storage['id']);
$storageQuery->execute();
- $storage['numeric_id'] = $this->connection->lastInsertId('*PREFIX*storages');
+ $storage['numeric_id'] = $storageQuery->getLastInsertId();
}
if (isset($storage['share_token'])) {
$shareExternalQuery
->setParameter(0, $storage['share_token'])
->setParameter(1, $storage['remote'])
- ->setParameter(4, $storage['user']);
- $shareExternalQuery->execute();
+ ->setParameter(2, 'irrelevant')
+ ->setParameter(3, 'irrelevant')
+ ->setParameter(4, $storage['user'])
+ ->setParameter(5, 'irrelevant')
+ ->setParameter(6, 'irrelevant');
+ $shareExternalQuery->executeStatement();
}
if (isset($storage['files_count'])) {
@@ -111,7 +115,7 @@ class CleanupRemoteStoragesTest extends TestCase {
$filesQuery->setParameter(0, $storage['numeric_id']);
$filesQuery->setParameter(1, 'file' . $i);
$filesQuery->setParameter(2, md5('file' . $i));
- $filesQuery->execute();
+ $filesQuery->executeStatement();
}
}
}
@@ -153,8 +157,8 @@ class CleanupRemoteStoragesTest extends TestCase {
->from('storages')
->where($qb->expr()->eq('numeric_id', $qb->createNamedParameter($numericId)));
- $qResult = $qb->execute();
- $result = $qResult->fetchAll();
+ $qResult = $qb->executeQuery();
+ $result = $qResult->fetch();
$qResult->closeCursor();
if (!empty($result)) {
return true;
@@ -165,8 +169,8 @@ class CleanupRemoteStoragesTest extends TestCase {
->from('filecache')
->where($qb->expr()->eq('storage', $qb->createNamedParameter($numericId)));
- $qResult = $qb->execute();
- $result = $qResult->fetchAll();
+ $qResult = $qb->executeQuery();
+ $result = $qResult->fetch();
$qResult->closeCursor();
if (!empty($result)) {
return true;