summaryrefslogtreecommitdiffstats
path: root/tests/unit/db/ItemMapperTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/db/ItemMapperTest.php')
-rw-r--r--tests/unit/db/ItemMapperTest.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/unit/db/ItemMapperTest.php b/tests/unit/db/ItemMapperTest.php
index ee3678b3d..56cfe62ab 100644
--- a/tests/unit/db/ItemMapperTest.php
+++ b/tests/unit/db/ItemMapperTest.php
@@ -118,14 +118,15 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
public function testReadFeed(){
- $sql = 'UPDATE `*PREFIX*news_feeds` `feeds` ' .
- 'JOIN `*PREFIX*news_items` `items` ' .
- 'ON `items`.`feed_id` = `feeds`.`id` ' .
- 'AND `feeds`.`user_id` = ? ' .
- 'AND `feeds`.`id` = ? ' .
- 'AND `items`.`id` <= ? ' .
- 'SET `items`.`status` = (`items`.`status` & ?) ';
- $params = array($this->user, 3, 6, ~StatusFlag::UNREAD);
+ $sql = 'UPDATE `*PREFIX*news_items` ' .
+ 'SET `status` = `status` & ? ' .
+ 'WHERE `feed_id` = ? ' .
+ 'AND `id` <= ? ' .
+ 'AND EXISTS (' .
+ 'SELECT * FROM `*PREFIX*news_feeds` ' .
+ 'WHERE `user_id` = ? ' .
+ 'AND `id` = ? ) ';
+ $params = array(~StatusFlag::UNREAD, 3, 6, $this->user, 3);
$this->setMapperResult($sql, $params);
$this->mapper->readFeed(3, 6, $this->user);
}