summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-01-07 10:22:30 +0100
committerMorris Jobke <hey@morrisjobke.de>2016-01-07 14:54:55 +0100
commitfddece9552a4b194cdce8c3916e33fa8597c9008 (patch)
treeac7ebf668c4dd677e92922e35ff7f0be189935b4 /tests
parent0a41cfefe38e8bf352895f2b87dd9a04fd627094 (diff)
downloadnextcloud-server-fddece9552a4b194cdce8c3916e33fa8597c9008.tar.gz
nextcloud-server-fddece9552a4b194cdce8c3916e33fa8597c9008.zip
Remove OC_DB::insertid
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db.php4
-rw-r--r--tests/lib/repair/repairlegacystorage.php2
2 files changed, 3 insertions, 3 deletions
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');
}
/**