Skip to content

Commit

Permalink
Add delete customer endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanito committed Jan 11, 2023
1 parent 27addcb commit 9f86bcb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Customers/CustomersEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ public function list(
);
}

public function delete(int $customerId): void
{
$this->restClient->deleteResource(
sprintf('/v2/customers/%d', $customerId)
);
}

/**
* @return Customer[]|PagedCollection
*/
Expand Down
11 changes: 11 additions & 0 deletions tests/Customers/CustomerClientIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,15 @@ public function testGetCustomersLazyLoadsPages()
['GET', 'https://api.helpscout.net/v2/customers?page=2'],
]);
}

public function testDeleteCustomer()
{
$this->stubResponse($this->getResponse(201));
$this->client->customers()->delete(1);

$this->verifySingleRequest(
'https://api.helpscout.net/v2/customers/1',
'DELETE'
);
}
}

0 comments on commit 9f86bcb

Please sign in to comment.