diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-06 23:43:27 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-06 23:43:43 +0200 |
commit | 65d28653ae1a1d2a7680ccfa694dbb7e2d4d750f (patch) | |
tree | 0e005dc5c41e7ba4c2dec602cea4d6e8aa2a4e65 /tests/unit | |
parent | 4f8b81c7a353b5704d3a1d7d438077ac06dfdb4d (diff) |
try marking same items as read if they contain the same content
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/service/ItemServiceTest.php | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/tests/unit/service/ItemServiceTest.php b/tests/unit/service/ItemServiceTest.php index 0c062ff4c..e9bf47490 100644 --- a/tests/unit/service/ItemServiceTest.php +++ b/tests/unit/service/ItemServiceTest.php @@ -272,34 +272,6 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { $this->assertTrue($item->isUnstarred()); } - public function testUnread(){ - $itemId = 3; - $item = new Item(); - $item->setStatus(128); - $item->setId($itemId); - $item->setRead(); - - $expectedItem = new Item(); - $expectedItem->setStatus(128); - $expectedItem->setUnread(); - $expectedItem->setId($itemId); - $expectedItem->setLastModified($this->time); - - $this->mapper->expects($this->once()) - ->method('find') - ->with($this->equalTo($itemId), $this->equalTo($this->user)) - ->will($this->returnValue($item)); - - $this->mapper->expects($this->once()) - ->method('update') - ->with($this->equalTo($expectedItem)); - - $this->itemService->read($itemId, false, $this->user); - - $this->assertTrue($item->isUnread()); - } - - public function testRead(){ $itemId = 3; $item = new Item(); @@ -314,17 +286,14 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { $expectedItem->setLastModified($this->time); $this->mapper->expects($this->once()) - ->method('find') - ->with($this->equalTo($itemId), $this->equalTo($this->user)) + ->method('readItem') + ->with($this->equalTo($itemId), + $this->equalTo(true), + $this->equalTo($this->time), + $this->equalTo($this->user)) ->will($this->returnValue($item)); - $this->mapper->expects($this->once()) - ->method('update') - ->with($this->equalTo($expectedItem)); - $this->itemService->read($itemId, true, $this->user); - - $this->assertTrue($item->isRead()); } @@ -471,5 +440,3 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { } - - |