diff options
Diffstat (limited to 'tests/db/ItemMapperTest.php')
-rw-r--r-- | tests/db/ItemMapperTest.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/db/ItemMapperTest.php b/tests/db/ItemMapperTest.php index 626ac2cd0..433120a9f 100644 --- a/tests/db/ItemMapperTest.php +++ b/tests/db/ItemMapperTest.php @@ -88,13 +88,12 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility { public function testFind(){ - $sql = $this->makeSelectQuery('WHERE `*PREFIX*news_items`.`id` = ? '); + $sql = $this->makeSelectQuery('AND `*PREFIX*news_items`.`id` = ? '); - $this->setMapperResult($sql, array($this->id, $this->userId), $this->row); + $this->setMapperResult($sql, array($this->userId, $this->id), $this->row); $result = $this->mapper->find($this->id, $this->userId); $this->assertEquals($this->items[0], $result); - } @@ -248,4 +247,15 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility { $this->assertEquals($this->items, $result); } + + public function testFindByGuidHash(){ + $hash = md5('test'); + $sql = $this->makeSelectQuery('AND `*PREFIX*news_items`.`guid_hash` = ? '); + + $this->setMapperResult($sql, array($this->userId, $hash), $this->row); + + $result = $this->mapper->findByGuidHash($hash, $this->userId); + $this->assertEquals($this->items[0], $result); + } + }
\ No newline at end of file |