From 1f2391b0cdf8e7a9f8d922c7c2f71acfc4bc6388 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 4 Apr 2013 13:23:03 +0200 Subject: move autopurge to itembl --- tests/db/FeedMapperTest.php | 28 +--------------------------- tests/db/ItemMapperTest.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 27 deletions(-) (limited to 'tests/db') diff --git a/tests/db/FeedMapperTest.php b/tests/db/FeedMapperTest.php index 58a683836..d7163be30 100644 --- a/tests/db/FeedMapperTest.php +++ b/tests/db/FeedMapperTest.php @@ -249,32 +249,6 @@ 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; - $status = StatusFlag::STARRED | StatusFlag::UNREAD; - $sql = 'DELETE FROM `*PREFIX*news_items` WHERE `id` < ? ' . - 'AND NOT ((`status` & ?) > 0)'; - $params = array($id, $status); - - $this->setMapperResult($sql, $params); - $this->mapper->deleteReadOlderThanId($id); - } + } \ No newline at end of file diff --git a/tests/db/ItemMapperTest.php b/tests/db/ItemMapperTest.php index ea0feadd8..de9b2b4ac 100644 --- a/tests/db/ItemMapperTest.php +++ b/tests/db/ItemMapperTest.php @@ -262,4 +262,32 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility { $this->assertEquals($this->items[0], $result); } + + 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; + $status = StatusFlag::STARRED | StatusFlag::UNREAD; + $sql = 'DELETE FROM `*PREFIX*news_items` WHERE `id` < ? ' . + 'AND NOT ((`status` & ?) > 0)'; + $params = array($id, $status); + + $this->setMapperResult($sql, $params); + $this->mapper->deleteReadOlderThanId($id); + } } \ No newline at end of file -- cgit v1.2.3