summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-26 11:08:14 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-26 11:08:14 +0100
commitd0fde9dbce129b0dbb94d577d9685764c7d5ea4b (patch)
treeef7724db5fa4cf373a4c2393972ec4e65953593a /tests
parent3560ac0555ef2fbb7320e946c36d46aeef71b0b5 (diff)
also use feedid because feed + guid hash are unique together
Diffstat (limited to 'tests')
-rw-r--r--tests/bl/FeedBlTest.php1
-rw-r--r--tests/db/ItemMapperTest.php9
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/bl/FeedBlTest.php b/tests/bl/FeedBlTest.php
index 2ec3d3e47..b43060112 100644
--- a/tests/bl/FeedBlTest.php
+++ b/tests/bl/FeedBlTest.php
@@ -197,6 +197,7 @@ class FeedBlTest extends \OCA\AppFramework\Utility\TestUtility {
$this->itemMapper->expects($this->once())
->method('findByGuidHash')
->with($this->equalTo($item->getGuidHash()),
+ $this->equalTo($feed->getId()),
$this->equalTo($this->user))
->will($this->returnValue($item));
$this->itemMapper->expects($this->once())
diff --git a/tests/db/ItemMapperTest.php b/tests/db/ItemMapperTest.php
index 7c1cb743e..f528e31c3 100644
--- a/tests/db/ItemMapperTest.php
+++ b/tests/db/ItemMapperTest.php
@@ -249,11 +249,14 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
public function testFindByGuidHash(){
$hash = md5('test');
- $sql = $this->makeSelectQuery('AND `*PREFIX*news_items`.`guid_hash` = ? ');
+ $feedId = 3;
+ $sql = $this->makeSelectQuery(
+ 'AND `items`.`guid_hash` = ? ' .
+ 'AND `feed`.`id = ? ');
- $this->setMapperResult($sql, array($this->userId, $hash), $this->row);
+ $this->setMapperResult($sql, array($this->userId, $hash, $feedId), $this->row);
- $result = $this->mapper->findByGuidHash($hash, $this->userId);
+ $result = $this->mapper->findByGuidHash($hash, $feedId, $this->userId);
$this->assertEquals($this->items[0], $result);
}