Skip to content

Commit

Permalink
fix contact list fetch endpoint's other default value
Browse files Browse the repository at this point in the history
- AUT-3246

Co-authored-by: Bence Kadar <bence.kadar@emarsys.com>
  • Loading branch information
fqqdk and bencekadaremar committed Sep 20, 2024
1 parent f1b2dd8 commit b6eb66c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Suite/Api/ContactList.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function getContactIdsInList(int $customerId, int $contactListId, int $to
}
}

public function getListChunkIterator(int $customerId, int $contactListId, int $chunkSize = 10000) : iterable
public function getListChunkIterator(int $customerId, int $contactListId, int $chunkSize = null) : iterable
{
$next = $this->endPoints->contactIdsInList($customerId, $contactListId, $chunkSize);
try {
Expand Down
15 changes: 15 additions & 0 deletions test/unit/Suite/Api/ContactListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,21 @@ public function getContactListChunkIterator_ListFitsInSingleChunk_ContactIdsRetu
$this->assertEquals([[1, 2, 3]], iterator_to_array($iterator));
}

/**
* @test
*/
public function getContactListChunkIterator_ChunkSizeNotPassed_TopNotSentInRequest(): void
{
$chunkSize = 3;
$this->apiClient->expects($this->once())->method('get')
->with("api_base_url/$this->customerId/contactlist/$this->contactListId/contactIds")
->willReturn(
$this->apiSuccess(['value' => [1, 2, 3], 'next' => null])
);
$iterator = $this->listService->getListChunkIterator($this->customerId, $this->contactListId);
$this->assertEquals([[1, 2, 3]], iterator_to_array($iterator));
}

/**
* @test
*/
Expand Down

0 comments on commit b6eb66c

Please sign in to comment.