diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-07 22:08:21 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-21 15:25:47 +0200 |
commit | f77e5f411dda91a7c4fc70c090825a036b7b1135 (patch) | |
tree | 6cc6cc88d7f3bb3ff137e2da5130e933ca1ab840 /tests | |
parent | 516f7e8299c309ed909259c90c23cb0ce6a8e4f7 (diff) | |
download | nextcloud-server-f77e5f411dda91a7c4fc70c090825a036b7b1135.tar.gz nextcloud-server-f77e5f411dda91a7c4fc70c090825a036b7b1135.zip |
Fix existing usages by removing the quotes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/repair/cleantags.php | 44 | ||||
-rw-r--r-- | tests/lib/share/share.php | 18 |
2 files changed, 31 insertions, 31 deletions
diff --git a/tests/lib/repair/cleantags.php b/tests/lib/repair/cleantags.php index fc9b21d4636..2f6d0879642 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('*PREFIX*vcategory') ->execute(); - $qb->delete('`*PREFIX*vcategory_to_object`') + $qb->delete('*PREFIX*vcategory_to_object') ->execute(); - $qb->delete('`*PREFIX*filecache`') + $qb->delete('*PREFIX*filecache') ->execute(); } @@ -84,8 +84,8 @@ class CleanTags extends \Test\TestCase { */ protected function assertEntryCount($tableName, $expected, $message = '') { $qb = $this->connection->getQueryBuilder(); - $result = $qb->select('COUNT(*)') - ->from('`' . $tableName . '`') + $result = $qb->select($qb->createFunction('COUNT(*)')) + ->from($tableName) ->execute(); $this->assertEquals($expected, $result->fetchColumn(), $message); @@ -100,15 +100,15 @@ class CleanTags extends \Test\TestCase { */ protected function addTagCategory($category, $type) { $qb = $this->connection->getQueryBuilder(); - $qb->insert('`*PREFIX*vcategory`') + $qb->insert('*PREFIX*vcategory') ->values([ - '`uid`' => $qb->createNamedParameter('TestRepairCleanTags'), - '`category`' => $qb->createNamedParameter($category), - '`type`' => $qb->createNamedParameter($type), + 'uid' => $qb->createNamedParameter('TestRepairCleanTags'), + 'category' => $qb->createNamedParameter($category), + 'type' => $qb->createNamedParameter($type), ]) ->execute(); - return (int) $this->getLastInsertID('`*PREFIX*vcategory`', '`id`'); + return (int) $this->getLastInsertID('*PREFIX*vcategory', 'id'); } /** @@ -119,11 +119,11 @@ class CleanTags extends \Test\TestCase { */ protected function addTagEntry($objectId, $category, $type) { $qb = $this->connection->getQueryBuilder(); - $qb->insert('`*PREFIX*vcategory_to_object`') + $qb->insert('*PREFIX*vcategory_to_object') ->values([ - '`objid`' => $qb->createNamedParameter($objectId, \PDO::PARAM_INT), - '`categoryid`' => $qb->createNamedParameter($category, \PDO::PARAM_INT), - '`type`' => $qb->createNamedParameter($type), + 'objid' => $qb->createNamedParameter($objectId, \PDO::PARAM_INT), + 'categoryid' => $qb->createNamedParameter($category, \PDO::PARAM_INT), + 'type' => $qb->createNamedParameter($type), ]) ->execute(); } @@ -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('*PREFIX*filecache') ->values([ - '`path`' => $qb->createNamedParameter($fileName), - '`path_hash`' => $qb->createNamedParameter(md5($fileName)), + 'path' => $qb->createNamedParameter($fileName), + 'path_hash' => $qb->createNamedParameter(md5($fileName)), ]) ->execute(); $fileName = $this->getUniqueID('TestRepairCleanTags', 12); - $qb->insert('`*PREFIX*filecache`') + $qb->insert('*PREFIX*filecache') ->values([ - '`path`' => $qb->createNamedParameter($fileName), - '`path_hash`' => $qb->createNamedParameter(md5($fileName)), + 'path' => $qb->createNamedParameter($fileName), + 'path_hash' => $qb->createNamedParameter(md5($fileName)), ]) ->execute(); - $this->createdFile = (int) $this->getLastInsertID('`*PREFIX*filecache`', '`fileid`'); + $this->createdFile = (int) $this->getLastInsertID('*PREFIX*filecache', 'fileid'); return $this->createdFile; } @@ -175,7 +175,7 @@ class CleanTags extends \Test\TestCase { // FIXME https://github.com/owncloud/core/issues/13303 // FIXME ALSO FIX https://github.com/owncloud/core/commit/2dd85ec984c12d3be401518f22c90d2327bec07a $qb = $this->connection->getQueryBuilder(); - $result = $qb->select("MAX($idName)") + $result = $qb->select($qb->createFunction('MAX(`' . $idName . '`)')) ->from($tableName) ->execute(); diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php index 816070afd8b..52511810efa 100644 --- a/tests/lib/share/share.php +++ b/tests/lib/share/share.php @@ -1287,12 +1287,12 @@ class Test_Share extends \Test\TestCase { // Find the share ID in the db $qb = $connection->getQueryBuilder(); - $qb->select('`id`') - ->from('`*PREFIX*share`') - ->where('`item_type` = :type') - ->andWhere('`item_source` = :source') - ->andWhere('`uid_owner` = :owner') - ->andWhere('`share_type` = :share_type') + $qb->select('id') + ->from('*PREFIX*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'))) + ->andWhere($qb->expr()->eq('share_type', $qb->createParameter('share_type'))) ->setParameter('type', 'test') ->setParameter('source', 'test.txt') ->setParameter('owner', $this->user1) @@ -1308,9 +1308,9 @@ class Test_Share extends \Test\TestCase { // Fetch the hash from the database $qb = $connection->getQueryBuilder(); - $qb->select('`share_with`') - ->from('`*PREFIX*share`') - ->where('`id` = :id') + $qb->select('share_with') + ->from('*PREFIX*share') + ->where($qb->expr()->eq('id', $qb->createParameter('id'))) ->setParameter('id', $id); $hash = $qb->execute()->fetch()['share_with']; |