diff options
Diffstat (limited to 'tests/db/FeedMapperTest.php')
-rw-r--r-- | tests/db/FeedMapperTest.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/db/FeedMapperTest.php b/tests/db/FeedMapperTest.php index c2dd6eced..90ad07626 100644 --- a/tests/db/FeedMapperTest.php +++ b/tests/db/FeedMapperTest.php @@ -129,4 +129,21 @@ class FeedMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility { $this->assertEquals($this->feeds, $result); } + + + public function testGetStarredCount(){ + $userId = 'john'; + $row = array( + array('size' => 9) + ); + $sql = 'SELECT COUNT(*) AS size FROM `*dbprefix*news_feeds` ' . + 'AND `user_id` = ? ' . + 'AND ((`status` & ?) > 0)'; + + $this->setMapperResult($sql, array($userId, StatusFlag::STARRED), $row); + + $result = $this->feedMapper->getStarredCount($userId); + $this->assertEquals($row[0]['size'], $result); + } + }
\ No newline at end of file |