summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Controller/ItemControllerTest.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/Unit/Controller/ItemControllerTest.php b/tests/Unit/Controller/ItemControllerTest.php
index a35df1552..b2f833868 100644
--- a/tests/Unit/Controller/ItemControllerTest.php
+++ b/tests/Unit/Controller/ItemControllerTest.php
@@ -131,15 +131,10 @@ class ItemControllerTest extends TestCase
public function testShare()
{
$this->itemService->expects($this->once())
- ->method('checkSharing')
- ->with(4, 'bob', 'jackob')
- ->will($this->returnValue(0));
+ ->method('share')
+ ->with('user', 4, 'test');
- $this->itemService->expects($this->once())
- ->method('shareItem')
- ->with(4, 'bob', 'jackob');
-
- $this->controller->share(4, 'bob');
+ $this->controller->share(4, 'test');
}
@@ -148,16 +143,11 @@ class ItemControllerTest extends TestCase
$msg = 'hi';
$this->itemService->expects($this->once())
- ->method('checkSharing')
- ->with(4, 'bob', 'jackob')
- ->will($this->returnValue(0));
-
- $this->itemService->expects($this->once())
- ->method('shareItem')
- ->with(4, 'bob', 'jackob')
+ ->method('share')
+ ->with('user', 4, 'test')
->will($this->throwException(new ServiceNotFoundException($msg)));
- $response = $this->controller->share(4, 'bob');
+ $response = $this->controller->share(4, 'test');
$params = json_decode($response->render(), true);
$this->assertEquals($response->getStatus(), Http::STATUS_NOT_FOUND);