Skip to content

Commit

Permalink
Merge pull request #300 from ryanito/master
Browse files Browse the repository at this point in the history
Add delete customer endpoint
  • Loading branch information
miguelrs authored Jan 17, 2023
2 parents 27addcb + 9f86bcb commit 2a49a96
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 2a49a96

Please sign in to comment.