Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/TestsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,13 @@ public function testGetSequencesWithTotalCount()
public function testGetSequencesPagination()
{
$result = $this->api->get_sequences(
include_total_count: true,
per_page: 1
);

// Store total count, as other sequences may exist on the account.
$totalCount = $result->pagination->total_count;

// Assert sequences and pagination exist.
$this->assertDataExists($result, 'sequences');
$this->assertPaginationExists($result);
Expand All @@ -973,7 +977,7 @@ public function testGetSequencesPagination()

// Assert has_previous_page and has_next_page are correct.
$this->assertTrue($result->pagination->has_previous_page);
$this->assertFalse($result->pagination->has_next_page);
$this->assertEquals($totalCount > 2, $result->pagination->has_next_page);

// Use pagination to fetch previous page.
$result = $this->api->get_sequences(
Expand Down Expand Up @@ -4691,8 +4695,8 @@ public function testFilterSubscribersPagination()
$this->assertCount(1, $result->subscribers);

// Assert has_previous_page and has_next_page are correct.
$this->assertTrue($result->pagination->has_previous_page);
$this->assertFalse($result->pagination->has_next_page);
$this->assertFalse($result->pagination->has_previous_page);
$this->assertTrue($result->pagination->has_next_page);
}

/**
Expand Down
Loading