diff options
Diffstat (limited to 'tests/db/ItemMapperTest.php')
-rw-r--r-- | tests/db/ItemMapperTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/db/ItemMapperTest.php b/tests/db/ItemMapperTest.php index 82b5b2faf..fb37f9bc0 100644 --- a/tests/db/ItemMapperTest.php +++ b/tests/db/ItemMapperTest.php @@ -76,6 +76,21 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility { $this->assertEquals($this->items[0], $result); } + + + public function testFindByUrlHash(){ + $urlHash = md5('hihi'); + $sql = 'SELECT `*dbprefix*news_items`.* FROM `*dbprefix*news_items` ' . + 'JOIN `*dbprefix*news_feeds` ' . + 'ON `*dbprefix*news_feeds`.`id` = `*dbprefix*news_items`.`feed_id` ' . + 'WHERE `*dbprefix*news_items`.`url_hash` = ? ' . + 'AND `*dbprefix*news_feeds`.`user_id` = ? '; + $this->setMapperResult($sql, array($urlHash, $this->userId), $this->row); + + $result = $this->itemMapper->findByUrlHash($urlHash, $this->userId); + $this->assertEquals($this->items[0], $result); + } + // // public function testFindNotFound(){ // $sql = 'SELECT `*dbprefix*news_items`.* FROM `*dbprefix*news_items` ' . |