Skip to content

Commit

Permalink
Fixed test assertion for json protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 10, 2024
1 parent 7eafc1d commit 641c808
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/AblyRestRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ public function testBatchPublishMultipleChannelsUsingPostRequest() {
$this->assertNull($batchPublishPaginatedResult->errorMessage);
$this->assertTrue( $batchPublishPaginatedResult->isLast(), 'Expected not to be the last page' );

$this->assertEquals("application/x-msgpack", $batchPublishPaginatedResult->headers["Content-Type"]);
if (self::$ably->options->useBinaryProtocol) {
$this->assertEquals("application/x-msgpack", $batchPublishPaginatedResult->headers["Content-Type"]);
} else {
$this->assertEquals("application/json", $batchPublishPaginatedResult->headers["Content-Type"]);
}
$this->assertCount(4, $batchPublishPaginatedResult->items);
foreach ($batchPublishPaginatedResult->items as $key=> $item) {
$this->assertEquals("channel".($key + 1), $item->channel);
$this->assertEquals(1, $item->messageId);
}

foreach (["channel1", "channel2", "channel3", "channel4"] as $channelName) {
print $channelName;
$channel = self::$ably->channel($channelName);
$paginatedHistory = $channel->history();
foreach ($paginatedHistory->items as $msg) {
Expand Down

0 comments on commit 641c808

Please sign in to comment.