summaryrefslogtreecommitdiffstats
path: root/tests/unit/service/ItemServiceTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/service/ItemServiceTest.php')
-rw-r--r--tests/unit/service/ItemServiceTest.php43
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 {
}
-
-