summaryrefslogtreecommitdiffstats
path: root/tests/db/FeedMapperTest.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-20 19:30:05 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-20 19:30:05 +0100
commitc26baa1eb7803f2291612c866d7610679f51f6d6 (patch)
treefa638a20832c7fac247ceb354b39fdcacc8b0b10 /tests/db/FeedMapperTest.php
parent9c78fd8295f8e27cdb8fe8c4e10ffae650bc14d0 (diff)
finished feedmapper
Diffstat (limited to 'tests/db/FeedMapperTest.php')
-rw-r--r--tests/db/FeedMapperTest.php17
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