summaryrefslogtreecommitdiffstats
path: root/tests/db/FeedMapperTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/db/FeedMapperTest.php')
-rw-r--r--tests/db/FeedMapperTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/db/FeedMapperTest.php b/tests/db/FeedMapperTest.php
index 11afbbe7f..de414d9c8 100644
--- a/tests/db/FeedMapperTest.php
+++ b/tests/db/FeedMapperTest.php
@@ -249,4 +249,30 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
}
+ public function testGetReadOlderThanThreshold(){
+ $status = StatusFlag::STARRED | StatusFlag::UNREAD;
+ $sql = 'SELECT * FROM `*PREFIX*news_items` ' .
+ 'WHERE NOT ((`status` & ?) > 0)';
+ $threshold = 10;
+ $feed = new Feed();
+ $feed->setId(30);
+ $rows = array(array('id' => 30));
+ $params = array($status);
+
+ $this->setMapperResult($sql, $params, $rows);
+ $result = $this->mapper->getReadOlderThanThreshold($threshold);
+
+ $this->assertEquals($feed->getId(), $result[0]->getId());
+ }
+
+
+ public function testDeleteReadOlderThanId(){
+ $id = 10;
+ $sql = 'DELETE FROM `*PREFIX*news_items` WHERE `id` < ?';
+ $params = array($id);
+
+ $this->setMapperResult($sql, $params);
+ $this->mapper->deleteReadOlderThanId($id);
+ }
+
} \ No newline at end of file