Skip to content

Commit 7242b33

Browse files
committed
IBX-10458: Fixed pagination test
1 parent d515e75 commit 7242b33

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/lib/Repository/SiteAccessAware/ContentTypeService.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ public function findContentTypes(?ContentTypeQuery $query = null, array $priorit
126126
return $this->service->findContentTypes($query, $prioritizedLanguages);
127127
}
128128

129-
public function countContentTypes(?ContentTypeQuery $query = null): int
130-
{
131-
return $this->service->countContentTypes($query);
132-
}
133-
134129
public function loadContentTypes(ContentTypeGroup $contentTypeGroup, ?array $prioritizedLanguages = null): iterable
135130
{
136131
$prioritizedLanguages = $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages);

tests/integration/Core/Repository/ContentTypeService/FindContentTypesTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ public function testPagination(): void
9393
$pageSize = 10;
9494
$noOfPages = 3;
9595

96-
for ($offset = 0; $offset < $noOfPages; $offset += $pageSize) {
96+
for ($page = 1; $page <= $noOfPages; ++$page) {
97+
$offset = ($page - 1) * $pageSize;
9798
$searchResult = $contentTypeService->findContentTypes(
98-
new ContentTypeQuery(null, [], $offset, $pageSize),
99+
new ContentTypeQuery(null, [new Identifier()], $offset, $pageSize),
99100
);
100101

101102
// an actual number of items on a current page

0 commit comments

Comments
 (0)