diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-12 11:54:49 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-12 11:54:49 +0200 |
commit | 3baa8b51e42a1d353d5d9335a4c464d224027a40 (patch) | |
tree | 7e4ffdf3722b176836bbda84b046ab3d85e44b51 /tests | |
parent | e8cdb315693dce4212597932ab99ccc23ec8ab0c (diff) |
implement mark as read for feeds and folders, fix #29
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/db/ItemMapperTest.php | 17 | ||||
-rw-r--r-- | tests/unit/utility/FeedFetcherTest.php | 2 |
2 files changed, 10 insertions, 9 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); } diff --git a/tests/unit/utility/FeedFetcherTest.php b/tests/unit/utility/FeedFetcherTest.php index 61fe78c64..ba4a53db1 100644 --- a/tests/unit/utility/FeedFetcherTest.php +++ b/tests/unit/utility/FeedFetcherTest.php @@ -33,7 +33,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility { private $fetcher; protected function setUp(){ - $this->fetcher = new FeedFetcher($this->getAPIMock()); + $this->fetcher = new FeedFetcher($this->getAPIMock(), 'dir', 300); } |