diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-04 13:12:07 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-04 13:12:07 +0200 |
commit | 4b994c97ad878cc3886ffbea1a6a2bf6b4a98def (patch) | |
tree | 85d464146ad809a68372abed3a4026578d4006ad /tests/db | |
parent | 312796b1ca251567159368dddcaed1a3f0ddafc0 (diff) |
autopurge all read items which are not starred if there are more than 1000
Diffstat (limited to 'tests/db')
-rw-r--r-- | tests/db/FeedMapperTest.php | 26 |
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 |