From 0547a69693364fa7e966c09c847f58f513da7226 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 9 Oct 2024 14:36:04 +0200 Subject: [PATCH] test(findAll): Add a more complex test Signed-off-by: Marcel Klehr --- tests/FindTest.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/FindTest.php b/tests/FindTest.php index ba68f5ac4..49f3874c8 100644 --- a/tests/FindTest.php +++ b/tests/FindTest.php @@ -102,16 +102,35 @@ public function testFindAllWithOr() { public function testFindByTags() { $params = new QueryParameters(); - $bookmarks = $this->bookmarkMapper->findALl($this->userId, $params->setTags(['one', 'three'])); + $bookmarks = $this->bookmarkMapper->findAll($this->userId, $params->setTags(['one', 'three'])); $this->assertCount(1, $bookmarks); } public function testFindByTagsAndSearch() { $params = new QueryParameters(); - $bookmarks = $this->bookmarkMapper->findALl($this->userId, $params->setTags(['one'])->setSearch(['php'])); + $bookmarks = $this->bookmarkMapper->findAll($this->userId, $params->setTags(['one'])->setSearch(['php'])); $this->assertCount(1, $bookmarks); } + public function testFindByFolderSortTitle() { + $rootFolder = $this->folderMapper->findRootFolder($this->userId); + $params = new QueryParameters(); + $bookmarks = $this->bookmarkMapper->findAll($this->userId, + $params + ->setFolder($rootFolder->getId()) + ->setSortBy('title') + ->setSoftDeleted(false) + ->setSoftDeletedFolders(false) + ->setConjunction('or') + ->setLimit(100) + ->setOffset(0) + ->setUntagged(false) + ->setTags([]) + ->setSearch([]) + ); + $this->assertCount(5, $bookmarks); + } + /** * @return array */