summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Schaal <daniel@schaal.email>2016-11-18 16:03:31 +0100
committerBernhard Posselt <BernhardPosselt@users.noreply.github.com>2016-11-18 16:03:31 +0100
commitf658beaf61962686738946211101321e2dcf860c (patch)
treeb1b9177eb98ca635a92b2f62d0a585435365fc61 /tests
parent7183da78c620eba60b33a4c4ad7ea5b206b6a69e (diff)
Throw ServiceNotFoundException when marking non-existent item as read (#61)
* Throw ServiceNotFoundException when marking non-existent item as read Fixes #58 * Add test case for marking non-existent item as read
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Service/ItemServiceTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/Unit/Service/ItemServiceTest.php b/tests/Unit/Service/ItemServiceTest.php
index 107b6aef3..3b3197136 100644
--- a/tests/Unit/Service/ItemServiceTest.php
+++ b/tests/Unit/Service/ItemServiceTest.php
@@ -298,6 +298,18 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase {
}
+ public function testReadDoesNotExist(){
+
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
+ $this->mapper->expects($this->once())
+ ->method('readItem')
+ ->will($this->throwException(new DoesNotExistException('')));
+
+ $this->itemService->read(1, true, $this->user);
+ }
+
public function testStarDoesNotExist(){
$this->setExpectedException(