From 4b6816914221193d4812eafb75d329d230bbd08e Mon Sep 17 00:00:00 2001 From: Paul Tirk Date: Tue, 12 Apr 2022 17:23:07 +0200 Subject: also allow starring/unstarring multiple items by id Signed-off-by: Paul Tirk --- tests/Unit/Controller/ItemApiControllerTest.php | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tests') diff --git a/tests/Unit/Controller/ItemApiControllerTest.php b/tests/Unit/Controller/ItemApiControllerTest.php index 749bb2d98..400c4fc32 100644 --- a/tests/Unit/Controller/ItemApiControllerTest.php +++ b/tests/Unit/Controller/ItemApiControllerTest.php @@ -517,4 +517,33 @@ class ItemApiControllerTest extends TestCase $this->class->unstarByItemId(123); } + + + public function testStarMultipleByItemIds() + { + $ids = [ 345, 678 ]; + + $this->itemService->expects($this->exactly(2)) + ->method('star') + ->withConsecutive( + [$this->user->getUID(), 345, true], + [$this->user->getUID(), 678, true] + ); + $this->class->starMultipleByItemIds($ids); + } + + + public function testUnstarMultipleByItemIds() + { + $ids = [ 345, 678 ]; + + $this->itemService->expects($this->exactly(2)) + ->method('star') + ->withConsecutive( + [$this->user->getUID(), 345, false], + [$this->user->getUID(), 678, false] + ); + + $this->class->unstarMultipleByItemIds($ids); + } } -- cgit v1.2.3