diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-27 13:02:18 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-27 13:02:18 +0100 |
commit | 003ab9ca77a2df654bdd152a29f9cf8071d55b68 (patch) | |
tree | 3c01000b075468eb29580832a081f74f566765fa | |
parent | 792ccc24949b66faa52bb68da8191b8a214bff36 (diff) |
delete existing item on update
-rw-r--r-- | bl/feedbl.php | 3 | ||||
-rw-r--r-- | tests/bl/FeedBlTest.php | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/bl/feedbl.php b/bl/feedbl.php index 9c594229a..7b9f98205 100644 --- a/bl/feedbl.php +++ b/bl/feedbl.php @@ -136,7 +136,8 @@ class FeedBl extends Bl { $item->setStatus($existing->getStatus()); $item->setUnread(); - $this->itemMapper->insert($item); + $this->itemMapper->delete($existing); + $this->itemMapper->insert($item); } } diff --git a/tests/bl/FeedBlTest.php b/tests/bl/FeedBlTest.php index c970ac837..9eee7eef1 100644 --- a/tests/bl/FeedBlTest.php +++ b/tests/bl/FeedBlTest.php @@ -244,6 +244,9 @@ class FeedBlTest extends \OCA\AppFramework\Utility\TestUtility { $this->equalTo($this->user)) ->will($this->returnValue($item2)); $this->itemMapper->expects($this->at(2)) + ->method('delete') + ->with($this->equalTo($item2)); + $this->itemMapper->expects($this->at(3)) ->method('insert') ->with($this->equalTo($item)); |