From 89d7293e845ee7bcc9b55910c1a0bb30b3c6e5ad Mon Sep 17 00:00:00 2001 From: Marco Nassabain Date: Tue, 16 Feb 2021 16:31:43 +0100 Subject: =?UTF-8?q?=E2=9C=85=20Add=20tests:=20testFindAllShared,=20testSha?= =?UTF-8?q?re=20+=20...=20+=20testShareDoesNotExist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Nassabain --- tests/Unit/Service/ItemServiceTest.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'tests/Unit/Service') diff --git a/tests/Unit/Service/ItemServiceTest.php b/tests/Unit/Service/ItemServiceTest.php index ce4e927e2..04c89ae28 100644 --- a/tests/Unit/Service/ItemServiceTest.php +++ b/tests/Unit/Service/ItemServiceTest.php @@ -174,7 +174,31 @@ class ItemServiceTest extends TestCase $this->assertEquals(['val'], $result); } - public function testFindAllItems() + + public function testFindAllShared() + { + $type = FeedType::SHARED; + $this->mapper->expects($this->once()) + ->method('findAllShared') + ->with( + $this->equalTo(20), + $this->equalTo(5), + $this->equalTo(true), + $this->equalTo(true), + $this->equalTo('jack'), + $this->equalTo([]) + ) + ->will($this->returnValue(['val'])); + + $result = $this->itemService->findAllItems( + 3, $type, 20, 5, + true, true, 'jack' + ); + $this->assertEquals(['val'], $result); + } + + + public function testFindAll() { $type = ListType::STARRED; $this->mapper->expects($this->once()) -- cgit v1.2.3