From fddece9552a4b194cdce8c3916e33fa8597c9008 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 7 Jan 2016 10:22:30 +0100 Subject: Remove OC_DB::insertid --- tests/lib/db.php | 4 ++-- tests/lib/repair/repairlegacystorage.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/lib/db.php b/tests/lib/db.php index 95eca4774b7..88c9ee75b3b 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -111,11 +111,11 @@ class Test_DB extends \Test\TestCase { public function testLastInsertId() { $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)'); $result1 = OC_DB::executeAudited($query, array('insertid 1','uri_1')); - $id1 = OC_DB::insertid('*PREFIX*'.$this->table2); + $id1 = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*'.$this->table2); // we don't know the id we should expect, so insert another row $result2 = OC_DB::executeAudited($query, array('insertid 2','uri_2')); - $id2 = OC_DB::insertid('*PREFIX*'.$this->table2); + $id2 = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*'.$this->table2); // now we can check if the two ids are in correct order $this->assertGreaterThan($id1, $id2); } diff --git a/tests/lib/repair/repairlegacystorage.php b/tests/lib/repair/repairlegacystorage.php index 44afd6125ab..3ae6578f7ec 100644 --- a/tests/lib/repair/repairlegacystorage.php +++ b/tests/lib/repair/repairlegacystorage.php @@ -99,7 +99,7 @@ class RepairLegacyStorages extends TestCase { $numRows = $this->connection->executeUpdate($sql, array($storageId)); $this->assertEquals(1, $numRows); - return \OC_DB::insertid('*PREFIX*storages'); + return \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*storages'); } /** -- cgit v1.2.3