diff options
author | Joas Schilling <coding@schilljs.com> | 2020-11-05 10:50:53 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-11-09 12:28:17 +0100 |
commit | 8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32 (patch) | |
tree | 1bf182f477bfbead7b75ae14a8cd0fce5bb38ada /apps/files_sharing | |
parent | 72545ffd07a07f142c9c18b3e4afc9ae1b5c8da2 (diff) | |
download | nextcloud-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.php | 10 | ||||
-rw-r--r-- | apps/files_sharing/tests/Migration/SetPasswordColumnTest.php | 4 |
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) { |