diff options
-rw-r--r-- | lib/private/comments/manager.php | 2 | ||||
-rw-r--r-- | tests/lib/comments/manager.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/comments/manager.php b/lib/private/comments/manager.php index 05f981f244d..09e59f28370 100644 --- a/lib/private/comments/manager.php +++ b/lib/private/comments/manager.php @@ -455,7 +455,7 @@ class Manager implements ICommentsManager { ->execute(); if ($affectedRows > 0) { - $comment->setId(strval($this->dbConn->lastInsertId('*PREFIX*comments'))); + $comment->setId(strval($qb->getLastInsertId())); } return $affectedRows > 0; diff --git a/tests/lib/comments/manager.php b/tests/lib/comments/manager.php index d5c415c250a..c8d65c951e3 100644 --- a/tests/lib/comments/manager.php +++ b/tests/lib/comments/manager.php @@ -46,7 +46,7 @@ class Test_Comments_Manager extends TestCase ]) ->execute(); - return \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*comments'); + return $qb->getLastInsertId(); } protected function getManager() { @@ -90,7 +90,7 @@ class Test_Comments_Manager extends TestCase ]) ->execute(); - $id = strval(\OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*comments')); + $id = strval($qb->getLastInsertId()); $comment = $manager->get($id); $this->assertTrue($comment instanceof \OCP\Comments\IComment); |