summaryrefslogtreecommitdiffstats
path: root/tests/db/FeedMapperTest.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-22 21:39:39 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-22 21:39:39 +0100
commitf9107664b01ba6f9cb3283a08a9ae4baf6026215 (patch)
treec3d783e4de04c65ec4bbaf6d86acde5ab8199f0f /tests/db/FeedMapperTest.php
parent91a327f5c687014fe20b531b9a42b98fe151d017 (diff)
made mappers faster by only joining the relevant rows for each user
Diffstat (limited to 'tests/db/FeedMapperTest.php')
-rw-r--r--tests/db/FeedMapperTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/db/FeedMapperTest.php b/tests/db/FeedMapperTest.php
index d1cbf5bff..71f82a26b 100644
--- a/tests/db/FeedMapperTest.php
+++ b/tests/db/FeedMapperTest.php
@@ -56,7 +56,7 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
$rows = array(
array('id' => $this->feeds[0]->getId()),
);
- $sql = 'SELECT * FROM `*dbprefix*news_feeds` ' .
+ $sql = 'SELECT * FROM `*PREFIX*news_feeds` ' .
'WHERE `id` = ? ' .
'AND `user_id` = ?';
@@ -71,7 +71,7 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
public function testFindNotFound(){
$userId = 'john';
$id = 3;
- $sql = 'SELECT * FROM `*dbprefix*news_feeds` ' .
+ $sql = 'SELECT * FROM `*PREFIX*news_feeds` ' .
'WHERE `id` = ? ' .
'AND `user_id` = ?';
@@ -89,7 +89,7 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
array('id' => $this->feeds[0]->getId()),
array('id' => $this->feeds[1]->getId())
);
- $sql = 'SELECT * FROM `*dbprefix*news_feeds` ' .
+ $sql = 'SELECT * FROM `*PREFIX*news_feeds` ' .
'WHERE `id` = ? ' .
'AND `user_id` = ?';
@@ -106,7 +106,7 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
array('id' => $this->feeds[0]->getId()),
array('id' => $this->feeds[1]->getId())
);
- $sql = 'SELECT * FROM `*dbprefix*news_feeds`';
+ $sql = 'SELECT * FROM `*PREFIX*news_feeds`';
$this->setMapperResult($sql, array(), $rows);
@@ -122,8 +122,8 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
array('id' => $this->feeds[1]->getId())
);
$sql = 'SELECT `feeds`.*, COUNT(`items`.`id`) AS `unread_count` ' .
- 'FROM `*dbprefix*news_feeds` `feeds` ' .
- 'LEFT OUTER JOIN `*dbprefix*news_items` `items` ' .
+ 'FROM `*PREFIX*news_feeds` `feeds` ' .
+ 'LEFT OUTER JOIN `*PREFIX*news_items` `items` ' .
'ON `feeds`.`id` = `items`.`feed_id` ' .
'WHERE (`items`.`status` & ?) > 0 ' .
'AND `feeds`.`user_id` = ? ' .
@@ -141,7 +141,7 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
$row = array(
array('id' => $this->feeds[0]->getId()),
);
- $sql = 'SELECT * FROM `*dbprefix*news_feeds` ' .
+ $sql = 'SELECT * FROM `*PREFIX*news_feeds` ' .
'WHERE `url_hash` = ? ' .
'AND `user_id` = ?';
$this->setMapperResult($sql, array($urlHash, $this->user), $row);
@@ -153,7 +153,7 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
public function testFindByUrlHashNotFound(){
$urlHash = md5('hihi');
- $sql = 'SELECT * FROM `*dbprefix*news_feeds` ' .
+ $sql = 'SELECT * FROM `*PREFIX*news_feeds` ' .
'WHERE `url_hash` = ? ' .
'AND `user_id` = ?';
@@ -170,7 +170,7 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
array('id' => $this->feeds[0]->getId()),
array('id' => $this->feeds[1]->getId())
);
- $sql = 'SELECT * FROM `*dbprefix*news_feeds` ' .
+ $sql = 'SELECT * FROM `*PREFIX*news_feeds` ' .
'WHERE `url_hash` = ? ' .
'AND `user_id` = ?';