summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-16 17:16:42 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-16 17:16:42 +0200
commit42ca456a059b7bb228a37a60cd82f141fe927e54 (patch)
tree68073a46c82031050ffb46891a96680c3e20aeb4 /tests
parent43ca6673b479695a84c77bc48bd27655ed6c93b9 (diff)
fix bug that prevented marking read if the highestitemid was 0
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/db/ItemMapperTest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/db/ItemMapperTest.php b/tests/unit/db/ItemMapperTest.php
index a7fead8f0..ed47f175c 100644
--- a/tests/unit/db/ItemMapperTest.php
+++ b/tests/unit/db/ItemMapperTest.php
@@ -132,6 +132,19 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
}
+ public function testReadFeedShouldMarkAllAsReadWhenIdZero(){
+ $sql = 'UPDATE `*PREFIX*news_items` ' .
+ 'SET `status` = `status` & ? ' .
+ 'WHERE `feed_id` = ? ' .
+ 'AND EXISTS (' .
+ 'SELECT * FROM `*PREFIX*news_feeds` ' .
+ 'WHERE `user_id` = ? ' .
+ 'AND `id` = ? ) ';
+ $params = array(~StatusFlag::UNREAD, 3,$this->user, 3);
+ $this->setMapperResult($sql, $params);
+ $this->mapper->readFeed(3, 0, $this->user);
+ }
+
public function testFindAllNew(){
$sql = 'AND `items`.`id` >= ?';
$sql = $this->makeSelectQueryStatus($sql, $this->status);