aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-11-05 10:50:53 +0100
committerJoas Schilling <coding@schilljs.com>2020-11-09 12:28:17 +0100
commit8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32 (patch)
tree1bf182f477bfbead7b75ae14a8cd0fce5bb38ada /apps/files_sharing
parent72545ffd07a07f142c9c18b3e4afc9ae1b5c8da2 (diff)
downloadnextcloud-server-8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32.tar.gz
nextcloud-server-8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32.zip
Don't leave cursors open when tests fail
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php10
-rw-r--r--apps/files_sharing/tests/Migration/SetPasswordColumnTest.php4
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
index dd03ffc6668..b163583bf11 100644
--- a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
+++ b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php
@@ -142,7 +142,10 @@ class CleanupRemoteStoragesTest extends TestCase {
$qb->select('*')
->from('storages')
->where($qb->expr()->eq('numeric_id', $qb->createNamedParameter($numericId)));
- $result = $qb->execute()->fetchAll();
+
+ $qResult = $qb->execute();
+ $result = $qResult->fetchAll();
+ $qResult->closeCursor();
if (!empty($result)) {
return true;
}
@@ -151,7 +154,10 @@ class CleanupRemoteStoragesTest extends TestCase {
$qb->select('*')
->from('filecache')
->where($qb->expr()->eq('storage', $qb->createNamedParameter($numericId)));
- $result = $qb->execute()->fetchAll();
+
+ $qResult = $qb->execute();
+ $result = $qResult->fetchAll();
+ $qResult->closeCursor();
if (!empty($result)) {
return true;
}
diff --git a/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php b/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php
index 05cb34ac506..a0e8720d17c 100644
--- a/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php
+++ b/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php
@@ -107,7 +107,9 @@ class SetPasswordColumnTest extends TestCase {
$query = $this->connection->getQueryBuilder();
$query->select('*')
->from('share');
- $allShares = $query->execute()->fetchAll();
+ $result = $query->execute();
+ $allShares = $result->fetchAll();
+ $result->closeCursor();
foreach ($allShares as $share) {
if ((int)$share['share_type'] === IShare::TYPE_LINK) {