aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/tests
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_trashbin/tests
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_trashbin/tests')
-rw-r--r--apps/files_trashbin/tests/Command/CleanUpTest.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php
index d7a654e519d..329089bcafa 100644
--- a/apps/files_trashbin/tests/Command/CleanUpTest.php
+++ b/apps/files_trashbin/tests/Command/CleanUpTest.php
@@ -124,9 +124,13 @@ class CleanUpTest extends TestCase {
// if the delete operation was execute only files from user1
// should be left.
$query = $this->dbConnection->getQueryBuilder();
- $result = $query->select('user')
- ->from($this->trashTable)
- ->execute()->fetchAll();
+ $query->select('user')
+ ->from($this->trashTable);
+
+ $qResult = $query->execute();
+ $result = $qResult->fetchAll();
+ $qResult->closeCursor();
+
$this->assertSame(5, count($result));
foreach ($result as $r) {
$this->assertSame('user1', $r['user']);