Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
totalimmersion committed Dec 5, 2024
1 parent 3497519 commit 22bd820
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions tests/integration/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1308,38 +1308,32 @@ public function testChannelPin()

// Pin the channel
$now = new \DateTime();
$member = $this->channel->pin($users[0]['id']);
$this->assertNotNull($member->channelMember->pinned_at);
$this->assertGreaterThanOrEqual($now->getTimestamp(), strtotime($member->channelMember->pinned_at));

// // Query for pinned channel
$queryChannResp = $client->queryChannels([
'user_id' => $users[0]['id'],
'filter' => [
'pinned' => true,
'cid' => $this->channel->getCID(),
],
]);Deze pas is niet gekoppeld. Ben je een zakelijke gebruiker? Neem dat contact op met jouw beheerder. Zo niet, neem dan contact op met de Rabobank. (908)

$channels = $queryChannResp['channels'];
$this->assertCount(1, $channels);
$this->assertEquals($channels[0]['cid'], $channel->getCID());
$response = $this->channel->pin($this->user1["id"]);
$this->assertNotNull($response["channel_member"]["pinned_at"]);
$this->assertGreaterThanOrEqual($now->getTimestamp(), strtotime($response["channel_member"]["pinned_at"]));

// Query for pinned channel
$response = $this->client->queryChannels([
"pinned" => true,
"cid" => $this->channel->getCID(),
], null, [
"user_id" => $this->user1["id"]
]);
$this->assertCount(1, $response["channels"]);
$this->assertEquals($this->channel->getCID(), $response["channels"][0]["channel"]["cid"]);

// Unpin the channel
$member = $channel->unpin($users[0]['id']);
$this->assertNull($member->channelMember->pinned_at);
$response = $this->channel->unpin($this->user1["id"]);
$this->assertNull($response["channel_member"]["pinned_at"]);

// Query for unpinned channel
$queryChannResp = $client->queryChannels([
'user_id' => $users[0]['id'],
'filter' => [
'pinned' => false,
'cid' => $this->channel->getCID(),
],
$response = $this->client->queryChannels([
"pinned" => false,
"cid" => $this->channel->getCID(),
], null, [
"user_id" => $this->user1["id"]
]);

$channels = $queryChannResp['channels'];
$this->assertCount(1, $channels);
$this->assertEquals($channels[0]['cid'], $channel->getCID());
$this->assertCount(1, $response["channels"]);
$this->assertEquals($this->channel->getCID(), $response["channels"][0]["channel"]["cid"]);
}
}

0 comments on commit 22bd820

Please sign in to comment.