diff options
author | Marco Nassabain <marco.nassabain@hotmail.com> | 2021-02-26 00:13:19 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-04-08 22:31:21 +0200 |
commit | 91c034c72f30618ff198e948d9ea21bac2afc6aa (patch) | |
tree | 5d551727379fef2525f53265f3c48581ba5e4cb2 /tests | |
parent | 88fc165f49da1b322fabaee63652a7062a526f6d (diff) |
✅ Fix ItemController share tests
- testShare
- testShareDoesNotExist
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Unit/Controller/ItemControllerTest.php | 22 |
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); |