From f77e5f411dda91a7c4fc70c090825a036b7b1135 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 7 Jul 2015 22:08:21 +0200 Subject: Fix existing usages by removing the quotes --- apps/files_trashbin/command/cleanup.php | 4 ++-- apps/files_trashbin/tests/command/cleanuptest.php | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'apps/files_trashbin') diff --git a/apps/files_trashbin/command/cleanup.php b/apps/files_trashbin/command/cleanup.php index de17020ea5c..0cc94912339 100644 --- a/apps/files_trashbin/command/cleanup.php +++ b/apps/files_trashbin/command/cleanup.php @@ -108,8 +108,8 @@ class CleanUp extends Command { if ($this->rootFolder->nodeExists('/' . $uid . '/files_trashbin')) { $this->rootFolder->get('/' . $uid . '/files_trashbin')->delete(); $query = $this->dbConnection->getQueryBuilder(); - $query->delete('`*PREFIX*files_trash`') - ->where($query->expr()->eq('`user`', ':uid')) + $query->delete('*PREFIX*files_trash') + ->where($query->expr()->eq('user', $query->createParameter('uid'))) ->setParameter('uid', $uid); $query->execute(); } diff --git a/apps/files_trashbin/tests/command/cleanuptest.php b/apps/files_trashbin/tests/command/cleanuptest.php index ecbaab98bf2..a7400e901fa 100644 --- a/apps/files_trashbin/tests/command/cleanuptest.php +++ b/apps/files_trashbin/tests/command/cleanuptest.php @@ -43,7 +43,7 @@ class CleanUpTest extends TestCase { protected $dbConnection; /** @var string */ - protected $trashTable = '`*PREFIX*files_trash`'; + protected $trashTable = '*PREFIX*files_trash'; /** @var string */ protected $user0 = 'user0'; @@ -69,14 +69,17 @@ class CleanUpTest extends TestCase { for ($i = 0; $i < 10; $i++) { $query->insert($this->trashTable) ->values(array( - '`id`' => $query->expr()->literal('file'.$i), - '`timestamp`' => $query->expr()->literal($i), - '`location`' => $query->expr()->literal('.'), - '`user`' => $query->expr()->literal('user'.$i%2) + 'id' => $query->expr()->literal('file'.$i), + 'timestamp' => $query->expr()->literal($i), + 'location' => $query->expr()->literal('.'), + 'user' => $query->expr()->literal('user'.$i%2) ))->execute(); } $getAllQuery = $this->dbConnection->getQueryBuilder(); - $result = $getAllQuery->select('`id`')->from($this->trashTable)->execute()->fetchAll(); + $result = $getAllQuery->select('id') + ->from($this->trashTable) + ->execute() + ->fetchAll(); $this->assertSame(10, count($result)); } @@ -107,7 +110,7 @@ class CleanUpTest extends TestCase { // if the delete operation was execute only files from user1 // should be left. $query = $this->dbConnection->getQueryBuilder(); - $result = $query->select('`user`') + $result = $query->select('user') ->from($this->trashTable) ->execute()->fetchAll(); $this->assertSame(5, count($result)); @@ -118,7 +121,10 @@ class CleanUpTest extends TestCase { // if no delete operation was execute we should still have all 10 // database entries $getAllQuery = $this->dbConnection->getQueryBuilder(); - $result = $getAllQuery->select('`id`')->from($this->trashTable)->execute()->fetchAll(); + $result = $getAllQuery->select('id') + ->from($this->trashTable) + ->execute() + ->fetchAll(); $this->assertSame(10, count($result)); } -- cgit v1.2.3