diff options
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/db/ItemMapperTest.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/unit/db/ItemMapperTest.php b/tests/unit/db/ItemMapperTest.php index 12597fb46..8b42aebb8 100644 --- a/tests/unit/db/ItemMapperTest.php +++ b/tests/unit/db/ItemMapperTest.php @@ -166,6 +166,24 @@ class ItemMapperTest extends \OCA\News\Tests\Unit\Db\MapperTestUtility { } + public function testReadFeed(){ + $sql = 'UPDATE `*PREFIX*news_items` ' . + 'SET `status` = `status` & ? ' . + ', `last_modified` = ? ' . + 'WHERE `feed_id` = ? ' . + 'AND `id` <= ? ' . + 'AND EXISTS (' . + 'SELECT * FROM `*PREFIX*news_feeds` ' . + 'WHERE `user_id` = ? ' . + 'AND `id` = ? ) '; + $params = [ + ~StatusFlag::UNREAD, $this->updatedSince, 3, 6, $this->user, 3 + ]; + $this->setMapperResult($sql, $params); + $this->mapper->readFeed(3, 6, $this->updatedSince, $this->user); + } + + public function testFindAllNew(){ $sql = 'AND `items`.`last_modified` >= ? '; $sql = $this->makeSelectQueryStatus($sql, $this->status); @@ -527,4 +545,4 @@ class ItemMapperTest extends \OCA\News\Tests\Unit\Db\MapperTestUtility { } -} +}
\ No newline at end of file |