Skip to content

Commit

Permalink
fixing test-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtigarg2584 committed Sep 25, 2024
1 parent b92227a commit ce2e928
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/ContentHubClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,6 @@ public function addFilterToWebhook($filter_id, $webhook_id) {
* @throws \Exception
*/
public function removeFilterFromWebhook($filter_id, $webhook_id) {
$options = ['body' => json_encode(['filter_id' => $filter_id])];
$response = $this->delete("filters/$filter_id/subscriptions/$webhook_id");

return self::getResponseJson($response);
Expand Down
8 changes: 4 additions & 4 deletions test/ContentHubClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2465,16 +2465,16 @@ public function testRemoveFilterFromWebhookFailsIfWebhookNotExists(): void {
$response = [
'request_id' => 'some-request-uuid',
'error' => [
'code' => 4004,
'message' => 'Webhook with the given uuid is not found.',
'code' => 4001,
'message' => 'filter is not registered for this account',
],
'success' => FALSE,
];

$this->ch_client
->shouldReceive('delete')
->once()
->with("settings/webhooks/{$webhook_id}/filters", ['body' => json_encode(['filter_id' => $filter_id])])
->with("filters/$filter_id/subscriptions/$webhook_id")
->andReturn($this->makeMockResponse(SymfonyResponse::HTTP_NOT_FOUND, [], json_encode($response)));

$this->assertSame($this->ch_client->removeFilterFromWebhook($filter_id, $webhook_id), $response);
Expand All @@ -2495,7 +2495,7 @@ public function testRemoveFilterFromWebhookSucceedsEvenIfFilterNotExists(): void
$this->ch_client
->shouldReceive('delete')
->once()
->with("settings/webhooks/{$webhook_id}/filters", ['body' => json_encode(['filter_id' => $filter_id])])
->with("filters/$filter_id/subscriptions/$webhook_id")
->andReturn($this->makeMockResponse(SymfonyResponse::HTTP_OK, [], json_encode($response)));

$this->assertSame($this->ch_client->removeFilterFromWebhook($filter_id, $webhook_id), $response);
Expand Down

0 comments on commit ce2e928

Please sign in to comment.