diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-22 13:20:24 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-22 13:20:24 +0100 |
commit | 196177a0ca3fc0103d359eec44f46173be685413 (patch) | |
tree | f721b656d64e240050980420202873e94f6e9edc /tests/db/ItemMapperTest.php | |
parent | 7a579b42fa731b65db26bd0c026bc68f2339c451 (diff) |
removed mapper parent class and use the new mapper methods from the framework
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` ' . |