summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-08-10 16:21:41 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-08-10 16:21:41 +0200
commite6eb74958fd9779362fbde788cbfac982783abc0 (patch)
tree500b7b12008967002ea3f86ddd1e2ed9602ba76e /tests
parent5fea6f753e27939a693041288d46115154dac051 (diff)
downloadnextcloud-server-e6eb74958fd9779362fbde788cbfac982783abc0.tar.gz
nextcloud-server-e6eb74958fd9779362fbde788cbfac982783abc0.zip
Remove unnecessary DB prefixes from existing query builder usages
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/repair/cleantags.php34
-rw-r--r--tests/lib/share/share.php4
2 files changed, 19 insertions, 19 deletions
diff --git a/tests/lib/repair/cleantags.php b/tests/lib/repair/cleantags.php
index 2f6d0879642..a511daa03d6 100644
--- a/tests/lib/repair/cleantags.php
+++ b/tests/lib/repair/cleantags.php
@@ -40,13 +40,13 @@ class CleanTags extends \Test\TestCase {
protected function cleanUpTables() {
$qb = $this->connection->getQueryBuilder();
- $qb->delete('*PREFIX*vcategory')
+ $qb->delete('vcategory')
->execute();
- $qb->delete('*PREFIX*vcategory_to_object')
+ $qb->delete('vcategory_to_object')
->execute();
- $qb->delete('*PREFIX*filecache')
+ $qb->delete('filecache')
->execute();
}
@@ -61,20 +61,20 @@ class CleanTags extends \Test\TestCase {
$this->addTagEntry(9999999, $cat3, 'contacts'); // Retained
$this->addTagEntry($this->getFileID(), $cat3 + 1, 'files'); // Deleted: Category is NULL
- $this->assertEntryCount('*PREFIX*vcategory_to_object', 4, 'Assert tag entries count before repair step');
- $this->assertEntryCount('*PREFIX*vcategory', 4, 'Assert tag categories count before repair step');
+ $this->assertEntryCount('vcategory_to_object', 4, 'Assert tag entries count before repair step');
+ $this->assertEntryCount('vcategory', 4, 'Assert tag categories count before repair step');
self::invokePrivate($this->repair, 'deleteOrphanFileEntries');
- $this->assertEntryCount('*PREFIX*vcategory_to_object', 3, 'Assert tag entries count after cleaning file entries');
- $this->assertEntryCount('*PREFIX*vcategory', 4, 'Assert tag categories count after cleaning file entries');
+ $this->assertEntryCount('vcategory_to_object', 3, 'Assert tag entries count after cleaning file entries');
+ $this->assertEntryCount('vcategory', 4, 'Assert tag categories count after cleaning file entries');
self::invokePrivate($this->repair, 'deleteOrphanTagEntries');
- $this->assertEntryCount('*PREFIX*vcategory_to_object', 2, 'Assert tag entries count after cleaning tag entries');
- $this->assertEntryCount('*PREFIX*vcategory', 4, 'Assert tag categories count after cleaning tag entries');
+ $this->assertEntryCount('vcategory_to_object', 2, 'Assert tag entries count after cleaning tag entries');
+ $this->assertEntryCount('vcategory', 4, 'Assert tag categories count after cleaning tag entries');
self::invokePrivate($this->repair, 'deleteOrphanCategoryEntries');
- $this->assertEntryCount('*PREFIX*vcategory_to_object', 2, 'Assert tag entries count after cleaning category entries');
- $this->assertEntryCount('*PREFIX*vcategory', 2, 'Assert tag categories count after cleaning category entries');
+ $this->assertEntryCount('vcategory_to_object', 2, 'Assert tag entries count after cleaning category entries');
+ $this->assertEntryCount('vcategory', 2, 'Assert tag categories count after cleaning category entries');
}
/**
@@ -100,7 +100,7 @@ class CleanTags extends \Test\TestCase {
*/
protected function addTagCategory($category, $type) {
$qb = $this->connection->getQueryBuilder();
- $qb->insert('*PREFIX*vcategory')
+ $qb->insert('vcategory')
->values([
'uid' => $qb->createNamedParameter('TestRepairCleanTags'),
'category' => $qb->createNamedParameter($category),
@@ -108,7 +108,7 @@ class CleanTags extends \Test\TestCase {
])
->execute();
- return (int) $this->getLastInsertID('*PREFIX*vcategory', 'id');
+ return (int) $this->getLastInsertID('vcategory', 'id');
}
/**
@@ -119,7 +119,7 @@ class CleanTags extends \Test\TestCase {
*/
protected function addTagEntry($objectId, $category, $type) {
$qb = $this->connection->getQueryBuilder();
- $qb->insert('*PREFIX*vcategory_to_object')
+ $qb->insert('vcategory_to_object')
->values([
'objid' => $qb->createNamedParameter($objectId, \PDO::PARAM_INT),
'categoryid' => $qb->createNamedParameter($category, \PDO::PARAM_INT),
@@ -141,21 +141,21 @@ class CleanTags extends \Test\TestCase {
// We create a new file entry and delete it after the test again
$fileName = $this->getUniqueID('TestRepairCleanTags', 12);
- $qb->insert('*PREFIX*filecache')
+ $qb->insert('filecache')
->values([
'path' => $qb->createNamedParameter($fileName),
'path_hash' => $qb->createNamedParameter(md5($fileName)),
])
->execute();
$fileName = $this->getUniqueID('TestRepairCleanTags', 12);
- $qb->insert('*PREFIX*filecache')
+ $qb->insert('filecache')
->values([
'path' => $qb->createNamedParameter($fileName),
'path_hash' => $qb->createNamedParameter(md5($fileName)),
])
->execute();
- $this->createdFile = (int) $this->getLastInsertID('*PREFIX*filecache', 'fileid');
+ $this->createdFile = (int) $this->getLastInsertID('filecache', 'fileid');
return $this->createdFile;
}
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index b6d3e16826d..ef0d9822085 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -1288,7 +1288,7 @@ class Test_Share extends \Test\TestCase {
// Find the share ID in the db
$qb = $connection->getQueryBuilder();
$qb->select('id')
- ->from('*PREFIX*share')
+ ->from('share')
->where($qb->expr()->eq('item_type', $qb->createParameter('type')))
->andWhere($qb->expr()->eq('item_source', $qb->createParameter('source')))
->andWhere($qb->expr()->eq('uid_owner', $qb->createParameter('owner')))
@@ -1309,7 +1309,7 @@ class Test_Share extends \Test\TestCase {
// Fetch the hash from the database
$qb = $connection->getQueryBuilder();
$qb->select('share_with')
- ->from('*PREFIX*share')
+ ->from('share')
->where($qb->expr()->eq('id', $qb->createParameter('id')))
->setParameter('id', $id);
$hash = $qb->execute()->fetch()['share_with'];