summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-08-19 12:06:00 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-08-26 11:54:25 +0200
commitac8941f6ac919464b672db5961f14604d681c628 (patch)
treea305f2627182f14ebd3a2810e053ab517315fb40
parentf4186d3dfccc80c6a819c94ece8883c981a9d013 (diff)
downloadnextcloud-server-ac8941f6ac919464b672db5961f14604d681c628.tar.gz
nextcloud-server-ac8941f6ac919464b672db5961f14604d681c628.zip
Manually query for the last id
-rw-r--r--apps/files_sharing/tests/api/shareestest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/api/shareestest.php b/apps/files_sharing/tests/api/shareestest.php
index c856b93d0fe..3b2e17d9fdc 100644
--- a/apps/files_sharing/tests/api/shareestest.php
+++ b/apps/files_sharing/tests/api/shareestest.php
@@ -859,7 +859,17 @@ class ShareesTest extends TestCase {
])
->setParameter('expiration', null, 'datetime')
->execute();
- return $connection->lastInsertId('share');
+
+ $queryBuilder = $connection->getQueryBuilder();
+ $query = $queryBuilder->select('id')
+ ->from('share')
+ ->orderBy('id', 'DESC')
+ ->setMaxResults(1)
+ ->execute();
+ $share = $query->fetch();
+ $query->closeCursor();
+
+ return (int) $share['id'];
}
/**