Skip to content

Commit

Permalink
Merge pull request #2230 from nextcloud/find-all-problem
Browse files Browse the repository at this point in the history
test(findAll): Add a more complex test
  • Loading branch information
marcelklehr authored Dec 1, 2024
2 parents ee8e57c + 0547a69 commit d771480
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tests/FindTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit d771480

Please sign in to comment.