From 8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 5 Nov 2020 10:50:53 +0100 Subject: Don't leave cursors open when tests fail Signed-off-by: Joas Schilling --- apps/files_trashbin/tests/Command/CleanUpTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'apps/files_trashbin/tests') 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']); -- cgit v1.2.3